Skip to content

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

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

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