You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(RESPECT NULLS / IGNORE NULLS is syntax for window functions, not aggregate functions #15006
In the SQL standard, RESPECT NULLS and IGNORE NULLS are options to be set for the lead, lag, first_value, last_value and nth_valuewindow functions.
Some window functions permit a null_treatment clause that specifies how to handle NULL values when calculating results. This clause is optional. It is part of the SQL standard, but the MySQL implementation permits only RESPECT NULLS (which is also the default).
The SQL standard defines a RESPECT NULLS or IGNORE NULLS option for lead, lag, first_value, last_value, and nth_value. This is not implemented in PostgreSQL: the behavior is always the same as the standard's default, namely RESPECT NULLS. Likewise, the standard's FROM FIRST or FROM LAST option for nth_value is not implemented: only the default FROM FIRST behavior is supported. (You can achieve the result of FROM LAST by reversing the ORDER BY ordering.)
Hi @vbarua I think I can first file a PR tackling this part.
RESPECT NULLS and IGNORE NULLS should not be valid options for aggregate functions.
Then a separate PR for the second part.
based on my research and reading, it seems that the most straightforward fix can be done here and I'll check if this is related to linked issues/PR above
I'm not sure about this part though
That being said, part of the weirdness here is that DataFusion defines first_value both as an aggregate function and as a window function.
Given DataFusion has tests for behaviour like this, I think it's considered part of the expected behaviour of DataFusion now. I'll close this as no action to take.
Activity
qazxcdswe123 commentedon Mar 5, 2025
Hi @vbarua I think I can first file a PR tackling this part.
RESPECT NULLS and IGNORE NULLS should not be valid options for aggregate functions.Then a separate PR for the second part.
based on my research and reading, it seems that the most straightforward fix can be done here and I'll check if this is related to linked issues/PR above
I'm not sure about this part though
Garamda commentedon Mar 16, 2025
fyi) #15014 (comment)
Jefffrey commentedon Oct 31, 2025
Given DataFusion has tests for behaviour like this, I think it's considered part of the expected behaviour of DataFusion now. I'll close this as no action to take.