-
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
Remove ArrayAgg Builtin in favor of UDF #11611
Conversation
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
if reverse_udf.name() == "ARRAY_AGG" { | ||
// If the function is changed, we need to reverse order_by clause as well | ||
// i.e. First(a order by b asc null first) -> Last(a order by b desc null last) | ||
if self.fun().name() == reverse_udf.name() { |
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 guess name checking is enough for now.
Introduce supports_rewrite_order_by
for AggregateUDFImpl might add additional complexity without benefit.
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 it would be good to eventually move this to a method in https://github.com/apache/datafusion/pull/11611
though I agree this is good for now. Maybe we can file a ticket to track
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.
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.
Looks good to me -- thank you @jayzhan211
if reverse_udf.name() == "ARRAY_AGG" { | ||
// If the function is changed, we need to reverse order_by clause as well | ||
// i.e. First(a order by b asc null first) -> Last(a order by b desc null last) | ||
if self.fun().name() == reverse_udf.name() { |
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 it would be good to eventually move this to a method in https://github.com/apache/datafusion/pull/11611
though I agree this is good for now. Maybe we can file a ticket to track
@@ -37,8 +36,6 @@ pub enum AggregateFunction { | |||
Min, | |||
/// Maximum | |||
Max, | |||
/// Aggregation into an array |
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.
🎉
Which issue does this PR close?
Closes #.
Part of #8708
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?