-
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 order_bys from AggregateExec state #8537
Remove order_bys from AggregateExec state #8537
Conversation
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 like a nice cleanup to me, but a review from @alamb would be helpful to ensure we are not missing some subtle use case.
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 agree this looks like a nice cleanup to me. Thank you @mustafasrepo
@@ -487,10 +483,10 @@ impl AggregateExec { | |||
)); | |||
let original_schema = Arc::new(original_schema); | |||
// Reset ordering requirement to `None` if aggregator is not order-sensitive | |||
order_by_expr = aggr_expr | |||
let mut order_by_expr = aggr_expr |
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 is the key observation, right? That the ordering can be derived from the AggregateExprs
themselves
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.
Exactly
Nice, thank you @mustafasrepo |
Which issue does this PR close?
Closes #.
Rationale for this change
While working on another PR, I realized that
Arc<dyn AggregateExpr>
hasorder_by
method, and keeps its requirement in its state. Hence, I thinkorder_bys
member which keeps requirement of each aggregate expression is redundant.What changes are included in this PR?
This PR removes
order_bys
member fromAggregateExec
struct.Are these changes tested?
Existing tests should work.
Are there any user-facing changes?