Skip to content

feat: Implement state conversion for remaining group accumulators#23275

Open
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:feat/accumulator_convert_state
Open

feat: Implement state conversion for remaining group accumulators#23275
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:feat/accumulator_convert_state

Conversation

@lyne7-sc

@lyne7-sc lyne7-sc commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

#23081 proposes making GroupsAccumulator::convert_to_state mandatory and removing supports_convert_to_state.

Before that API cleanup can happen, all existing GroupsAccumulator implementations need a correct convert_to_state implementation.

This PR is the first step toward that cleanup: it fills in missing convert_to_state implementations for the remaining group accumulators that currently participate in grouped aggregation.

What changes are included in this PR?

This PR adds convert_to_state support for:

  • PrimitiveDistinctCountGroupsAccumulator
  • HllGroupsAccumulator for approx_distinct
  • VarianceGroupsAccumulator
  • StddevGroupsAccumulator
  • CorrelationGroupsAccumulator
  • GeometricMeanGroupsAccumulator in the advanced UDAF example

Are these changes tested?

Yes. This PR adds unit tests for the new convert_to_state implementations.

Are there any user-facing changes?

No. This PR does not remove supports_convert_to_state yet and does not change the public GroupsAccumulator API.

@github-actions github-actions Bot added core Core DataFusion crate functions Changes to functions implementation labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant