fix: preserve current AQE logical-stage links on Comet operators - #5483
Open
sunchao wants to merge 1 commit into
Open
fix: preserve current AQE logical-stage links on Comet operators#5483sunchao 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?
Closes #5482.
Rationale for this change
AQE can reuse a native final aggregate above a shuffle stage and assign its physical root a direct link to the current
LogicalQueryStage. Comet's logical-link repair restores the olderoriginalPlan.logicalLink, or clears the link when the original has none.That older logical aggregate is hidden inside the logical-stage leaf. A later exchange can inherit the stale link, preventing Spark's identity-based replacement from inserting it into the active logical tree. The generated SQL regression demonstrates missed native broadcast adaptation on OSS Spark.
What changes are included in this PR?
LogicalQueryStagetag when revisiting aCometExec.No Spark changes, native execution changes, or configuration changes are required.
How are these changes tested?
Local validation on Linux x86_64 with JDK 17, Spark 4.1.3, and Scala 2.13.17:
make core(debug build, debug symbols disabled).CometExecRuleSuitetests, the new AQE broadcast test, and the existing shuffle logical-link test passed (33 tests).48738816; both broadcast aggregate producers output 64 rows, record positive native compute time, and retain direct logical-stage links.git diff --checkpassed.Local runtime coverage is Spark 4.1.3; the other Spark profiles and full suite remain for CI.