Skip to content

Use AccumulatorArgs::is_reversed in NthValueAgg - #11669

Merged
jayzhan211 merged 2 commits into
apache:mainfrom
jcsherin:reverse-expr-nth-value
Jul 27, 2024
Merged

jayzhan211 merged 2 commits into
apache:mainfrom
jcsherin:reverse-expr-nth-value

Conversation

@jcsherin

Copy link
Copy Markdown
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

@jayzhan211 jayzhan211 left a comment

Copy link
Copy Markdown
Contributor

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
@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