Skip to content
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

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Remove order_bys from AggregateExec state #8537

merged 2 commits into from
Dec 14, 2023

Conversation

mustafasrepo
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

While working on another PR, I realized that Arc<dyn AggregateExpr> has order_by method, and keeps its requirement in its state. Hence, I think order_bys member which keeps requirement of each aggregate expression is redundant.

What changes are included in this PR?

This PR removes order_bys member from AggregateExec struct.

Are these changes tested?

Existing tests should work.

Are there any user-facing changes?

@github-actions github-actions bot added the core Core DataFusion crate label Dec 14, 2023
Copy link
Contributor

@ozankabak ozankabak left a 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.

Copy link
Contributor

@alamb alamb left a 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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly

@Dandandan
Copy link
Contributor

Nice, thank you @mustafasrepo

@Dandandan Dandandan merged commit d67c0bb into apache:main Dec 14, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants