-
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
array_agg cannot perform both distinct and order_by #12371
Comments
take |
Plan to impl it following the behavior in duckdb.
|
Hi @Rachelint 👋, not sure if you were still looking at this, I need support for DISTINCT + ORDER BY in ARRAY_AGG as a prerequisite for #14412, so I ended up implementing it myself in #14413. If you are still working on this please let me know. |
@gabotechs Oh, sorry, i forget this actually... |
Describe the bug
Currently we can use
array_agg
withdistinct()
ororder_by()
but not both. Attempting to do so will create an error.To Reproduce
This minimal code will reproduce the problem:
You can run the code as is and it produces the expected result. If you uncomment the section where we try to do both you get
Expected behavior
A user should be able to apply both order_by and distinct in a single operation.
Additional context
In the code in datafusion/functions-aggregate/src/array_agg.rs
We have either
DistinctArrayAggAccumulator
orOrderSensitiveArrayAggAccumulator
but no option for both.This is related to #8583
The text was updated successfully, but these errors were encountered: