-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make ArragAgg (not ordered or distinct) into a UDAF #11045
Conversation
@@ -37,7 +37,7 @@ async fn csv_query_array_agg_distinct() -> Result<()> { | |||
Schema::new(vec![Field::new_list( | |||
"ARRAY_AGG(DISTINCT aggregate_test_100.c2)", | |||
Field::new("item", DataType::UInt32, true), | |||
false | |||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nullable
should be fixed together otherwise the test seems like regression to me 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we need further changes to resolve this one. See my comment here: #11063
let simplify = |aggregate_function: AggregateFunction, _: &dyn SimplifyInfo| { | ||
if aggregate_function.order_by.is_some() || aggregate_function.distinct { | ||
Ok(Expr::AggregateFunction(AggregateFunction { | ||
func_def: AggregateFunctionDefinition::BuiltIn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This's cool 😎
This follows how it done for input_type and only provide a single value. But might need to be changed into a Vec in the future. This is need when we are moving `arrag_agg` to udaf where one of the states nullability will depend on the nullability of the input.
2939e80
to
47ab253
Compare
Thanks @eejbyfeldt and @jayzhan211 -- this PR seems to be failing CI so I am marking it as a draft until that gets sorted out. I am working on reducing the review backlog |
Which issue does this PR close?
Part of #8708
Closes #10999.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Existing tests.
Are there any user-facing changes?
This adds UDAF for
ARRAY_AGG
when it not disitinct or ordered. The distinct and ordered will be handled in future PRs.