-
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
Remove expr_fn::sum and replace them with function stub #10816
Conversation
Signed-off-by: jayzhan211 <[email protected]>
@@ -5334,3 +5334,34 @@ physical_plan | |||
03)----AggregateExec: mode=Partial, gby=[], aggr=[first_value(convert_first_last_table.c1) ORDER BY [convert_first_last_table.c2 DESC NULLS FIRST]] | |||
04)------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 | |||
05)--------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/convert_first_last.csv]]}, projection=[c1, c2], output_orderings=[[c1@0 ASC NULLS LAST], [c2@1 DESC]], has_header=true | |||
|
|||
# test building plan with aggreagte sum |
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.
move the corresponding test in datafusion_expr to avoid introducing another stub
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
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 this looks good, fwiw
} | ||
|
||
#[derive(Debug)] | ||
pub struct Sum { |
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.
pub struct Sum { | |
/// Stub `sum` used for optimizer testing | |
pub struct Sum { |
Thank you @jayzhan211 |
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
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.
Thank you @jayzhan211 -- this looks great to me
I also updated this PR's description to add some additional rationale
@@ -168,20 +168,6 @@ pub fn max(expr: Expr) -> Expr { | |||
)) | |||
} | |||
|
|||
/// Create an expression to represent the sum() aggregate function | |||
/// | |||
/// TODO: Remove this function and use `sum` from `datafusion_functions_aggregate::expr_fn` instead |
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.
🎉
Thanks @alamb |
* introduce stub for test Signed-off-by: jayzhan211 <[email protected]> * fix err msg Signed-off-by: jayzhan211 <[email protected]> * dont compare error msg, ci is not consistent with local Signed-off-by: jayzhan211 <[email protected]> * comment and cli update Signed-off-by: jayzhan211 <[email protected]> * fmt Signed-off-by: jayzhan211 <[email protected]> --------- Signed-off-by: jayzhan211 <[email protected]>
Which issue does this PR close?
Part of #10731
Inspired from #10807 (comment)
Close #10807
Rationale for this change
The reason to add a stub is that as we pull the aggregate functions out of the core and into
datafusion-functions-aggregate
the existing optimizer passes don't depend on datafusion-functions-aggregate.Thus by using stubs we'll keep the optimizer passes decoupled from the built in aggregate functions as much as possible.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?