feat: add selective non-destructive grouped state reads - #74
Merged
Conversation
rkrishn7
force-pushed
the
preserving-grouped-state-api
branch
from
August 25, 2026 02:04
9d880ee to
06d254a
Compare
xudong963
requested changes
Aug 25, 2026
xudong963
left a comment
There was a problem hiding this comment.
Thanks for the thorough implementation and coverage. I found two correctness issues in valid preserving-read paths: an empty-selection panic for struct MIN/MAX, and unchecked offset truncation for selected variable-width group values. Requesting changes for these two cases.
zhuqi-lucas
reviewed
Aug 25, 2026
zhuqi-lucas
left a comment
There was a problem hiding this comment.
Read through the API and the impls. Mostly looks right - the evaluate/state split on the adapter lines up exactly with the two Accumulator contracts, and the byte-map keys path gets the offsets and the null slot right. Few things inline.
xudong963
approved these changes
Aug 26, 2026
zhuqi-lucas
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Long-lived grouped aggregation state currently must be drained and rebuilt to read a subset of groups. Preserving reads avoid that full-state round trip.
What changes are included in this PR?
GroupSelectionfor all groups or ordered group indices.GroupValuesandGroupsAccumulator.Are these changes tested?
Yes. Added tests cover repeated and reordered reads, duplicates, nulls, variable-width values, and updates after reads.
Validated with:
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningsdatafusion-expr-common,datafusion-functions-aggregate-common,datafusion-functions-aggregate, anddatafusion-physical-planunit testsAre there any user-facing changes?
Yes. This adds optional public trait methods and
GroupSelection. Existing implementations remain compatible through default methods.