fix: preserve aggregate result identity during exchange reuse - #5470
Draft
sunchao wants to merge 1 commit into
Draft
fix: preserve aggregate result identity during exchange reuse#5470sunchao wants to merge 1 commit into
sunchao wants to merge 1 commit into
Conversation
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?
No issue is automatically closed. This is a standalone aggregate identity fix with a regression added below.
Rationale for this change
Different aggregate result projections can currently have the same Comet plan identity. For example, an exchange above
COUNT(*) + 1can be considered reusable forCOUNT(*) - 1, even though the outputs differ. Distinct aggregates also need Spark's original result attributes to canonicalize equivalent plans correctly.What changes are included in this PR?
aggregateAttributesin Comet hash and object-hash aggregate conversion.CometAggregateSuite: count, distinct count, distinct count plus sum, and collect-set size. They distinguish different result projections while requiring equivalent projections with fresh aliases/IDs to remain reusable.Only the aggregate implementation and its existing test suite change. No join feature, native operator, or dependency changes are included.
How are these changes tested?
Draft: JVM validation is blocked, so no passing JVM test result is claimed.
5baa6b03; a subsequent locked build also passed.git diff --checkpassed.The new regressions and affected aggregate tests still need runtime validation before this draft is ready to merge.