Skip to content

Audit Comet logical-link repair across AQE replanning #6034

Description

@sunchao

What is the problem the feature request solves?

CometExecRule repairs links on CometExec, CometShuffleExchangeExec, and CometBroadcastExchangeExec using originalPlan.logicalLink, or clears both logical tags when that link is absent. #5482 / #5483 establish that originalPlan is not always authoritative: Spark can reuse an existing physical root and assign a direct link to the current LogicalQueryStage.

#5483 preserves that direct link on CometExec. This issue tracks the separate question raised in the review: which remaining repairs are necessary, and can link ownership be made explicit or repair narrowed without breaking AQE?

Describe the potential solution

Audit initial conversion, repeated AQE replanning, and exchange/subquery creation to document when the original plan, the current physical node, or Spark's temporary stage link is authoritative. Distinguish fresh nodes from reused physical nodes and direct tags from inherited tags. Decide from that evidence whether to retain the current repair, narrow it, or move necessary assignments to node creation.

Any change should preserve:

Back the chosen contract with focused planner tests and end-to-end AQE/DPP coverage that checks results and actual native execution. This audit does not assume all repair is removable or establish another failing exchange case.

Additional context

Keep #5482 focused on its reproduced stale-stage-link defect. The broader design question should remain tracked after #5483 closes that issue.

Current logical-link repair.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions