-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some aggregates silently ignore IGNORE NULLS
and ORDER BY
on arguments
#9924
Comments
IGNORE NULLS
and ORDER BY
on argumentsIGNORE NULLS
and ORDER BY
on arguments
@huaxingao this might be interesting |
@comphead Thanks for pinging me! I will work on this issue. |
I think for |
That is true, though applying an ORDER BY to the argument of COUNT may be much slower 🤔 (as DataFusion would have to sort the input) However, we could remove |
FWIW @jayzhan211 has a really nice API suggestion here I think https://github.com/apache/arrow-datafusion/pull/9920/files#r1549905825 Specifically, add these two functions to the /// Return true if the aggregate supports `IGNORE NULL`s
fn support_ignore_nulls() -> bool { false }
/// Return true if the aggregate supports and `ORDER BY` to specify its ordering:
/// `SELECT first_value(x ORDER BY y) ... `
fn support_ordering() -> bool { false } |
I wrote some tests for this feature in another PR that we decided not to use. I put them here #9953 in case that is helpful @huaxingao |
I think these APIs are very nice, clear. We can add these supports |
Describe the bug
DataFusion now supports providing ordering and nulls information to aggregates, but some aggregates ignore the flags silently
For example
To Reproduce
Also, for ordering
Expected behavior
I expect
To error with "IGNORE NULLS is not supported
I also expect
to error with "ORDER BY" not supported for avg
Additional context
@jayzhan211 has some good ideas at #9920 (comment) about how to make checking this easier / harder to miss
The text was updated successfully, but these errors were encountered: