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

Use AccumulatorArgs::is_reversed in NthValueAgg #11669

Merged
merged 2 commits into from
Jul 27, 2024

Conversation

jcsherin
Copy link
Contributor

Which issue does this PR close?

Closes #11668.

Rationale for this change

The AccmulatorArgs::is_reversed was introduced in #11564 for indicating that the aggregation order has been reversed. The existing implementation of NthValueAgg instead uses internal state.

I believe it makes sense to use the new is_reversed field with the added benefit of deleting some code from NthValueAgg.

What changes are included in this PR?

Refactors NthValueAgg to use AccumulatorArgs::is_reversed.

Are these changes tested?

This is a simple refactor of existing code, so only existing checks against CI.

Are there any user-facing changes?

Yes. A minor fix to doc comment for AggregateFunctionExpr::is_reversed.

@jcsherin jcsherin changed the title Reverse expr nth value Use AccumulatorArgs::is_reversed in NthValueAgg Jul 26, 2024
Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

Thanks @jcsherin

@jayzhan211 jayzhan211 merged commit 204e1bc into apache:main Jul 27, 2024
25 checks passed
@jcsherin jcsherin deleted the reverse-expr-nth-value branch July 27, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use AccumulatorArgs::is_reversed in NthValueAgg
2 participants