Skip to content

[SPARK-55877][UI] Side-by-side Initial vs Final plan comparison for AQE queries#54806

Closed
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-55877
Closed

[SPARK-55877][UI] Side-by-side Initial vs Final plan comparison for AQE queries#54806
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-55877

Conversation

@yaooqinn
Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Add a side-by-side comparison view for AQE plan evolution on the SQL execution detail page.

When AQE rewrites a query plan, the Plan Details section now shows a Unified | Split toggle:

  • Unified (default): full plan text as before
  • Split: two columns showing Initial Plan (left) vs Final Plan (right)

For non-AQE queries (where initial == final), the raw text is shown directly without the toggle.

Why are the changes needed?

Understanding how AQE rewrites a plan is important for query performance analysis. Currently the plan text mixes both versions in a single block, making it hard to compare. The split view makes differences immediately visible (e.g., added ShuffleQueryStage, AQEShuffleRead coalescing, statistics).

Does this PR introduce any user-facing change?

Yes — Plan Details section on the SQL execution page now shows a Unified/Split toggle when AQE has rewritten the plan.

How was this patch tested?

Compilation verified. Manual testing with AQE-enabled queries.

Was this patch authored or co-authored using generative AI tooling?

Yes, co-authored with GitHub Copilot.

…QE queries

Parse the physicalPlanDescription text to extract 'Initial Plan' and
'Final Plan' sections when AQE rewrites the plan. Display them with a
Unified/Split toggle button group:
- Unified (default): full plan text as before
- Split: two columns showing Initial Plan (left) vs Final Plan (right)

For non-AQE queries (where initial == final), the raw text is shown
directly without the toggle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yaooqinn
Copy link
Copy Markdown
Member Author

Screenshots

Unified view (default) — full plan text with Final Plan, Initial Plan, and node details:
unified

Split view — Initial Plan (left) vs Final Plan (right) side-by-side:
split

Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @yaooqinn .

@dongjoon-hyun
Copy link
Copy Markdown
Member

Merged to master.

@yaooqinn yaooqinn deleted the SPARK-55877 branch March 27, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants