[SPARK-55979][SQL] Required input attributes are missing from PartialMerge / Final BaseAggregateExec.references#54778
Open
zhztheplayer wants to merge 2 commits intoapache:masterfrom
Open
[SPARK-55979][SQL] Required input attributes are missing from PartialMerge / Final BaseAggregateExec.references#54778zhztheplayer wants to merge 2 commits intoapache:masterfrom
zhztheplayer wants to merge 2 commits intoapache:masterfrom
Conversation
…Merge / Final BaseAggregateExec.references
Member
|
Mind keeping the PR description template? |
Member
Author
|
@HyukjinKwon updated. I will investigate the CI error tomorrow. |
zhztheplayer
commented
Mar 13, 2026
| WholeStageCodegen (5) | ||
| Sort [s_state,_w0] | ||
| HashAggregate [sum] [sum(UnscaledValue(ss_net_profit)),_w0,s_state,sum] | ||
| HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),_w0,sum] |
Member
Author
There was a problem hiding this comment.
For example, in the golden file, the attributes not produced by this operator are now correctly shown in the references section.
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.
What changes were proposed in this pull request?
The patch updates BaseAggregateExec.producedAttributes, from
to
The patch fixes bug described below by adding
-- child.outputSetto exclude child's attributes from producedAttributes, ensuring producedAttributes doesn't include anything from the aggregate's input.Why are the changes needed?
The current implementation has bug causing a AggregateExec in
Finalmode gives fewer attributes inreferencesthan it really needs. Our downstream project has a rule to prune the unused inputs, relying on thereferencescall. This bug causes some needed inputs to be pruned accidentally.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Tested by newly added test case.
Was this patch authored or co-authored using generative AI tooling?
The test case was co-authored by AI and reviewed by PR author.