Skip to content

PHOENIX-7935 Propagate requested EXPLAIN options to nested plan contexts - #2544

Merged
apurtell merged 1 commit into
apache:PHOENIX-7876-featurefrom
apurtell:PHOENIX-7935
Jun 25, 2026
Merged

PHOENIX-7935 Propagate requested EXPLAIN options to nested plan contexts#2544
apurtell merged 1 commit into
apache:PHOENIX-7876-featurefrom
apurtell:PHOENIX-7935

Conversation

@apurtell

Copy link
Copy Markdown
Contributor

Previously PhoenixStatement set ExplainOptions only on the root plan's StatementContext. Nested plans (hash-join / semi-join / anti-join build sides, UNION ALL branches, sort-merge-join halves, and ClientScanPlan / ClientAggregatePlan / TupleProjectionPlan wrappers) kept their default options and rendered as plain explain output. Each parent's getExplainPlan() now copies getContext().getExplainOptions() onto its child plans' contexts before composing them. ExplainTable no longer special-cases the root scan.

Co-authored-by: Claude Opus 4.8[1m] noreply@anthropic.com

Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures EXPLAIN option selections (e.g., VERBOSE, REGIONS, FORMAT JSON) are consistently applied throughout nested query plan structures, so child scans/subplans render with the same disclosure level as the root plan.

Changes:

  • Propagates the parent plan’s ExplainOptions into nested/child StatementContexts before composing ExplainPlans.
  • Updates join/union plan explain composition to ensure both halves/branches/subplans render in the requested explain mode.
  • Ensures client wrapper plans pass explain options through to their delegate plans (and associated contexts used for client-side filters).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
phoenix-core-client/src/main/java/org/apache/phoenix/execute/UnionPlan.javaCopies root ExplainOptions to each UNION branch context before composing branch explain plans.
phoenix-core-client/src/main/java/org/apache/phoenix/execute/TupleProjectionPlan.javaCopies delegate ExplainOptions onto the separate post-filter statementContext so verbose client filters render consistently.
phoenix-core-client/src/main/java/org/apache/phoenix/execute/SortMergeJoinPlan.javaPropagates ExplainOptions to both LHS/RHS plan contexts prior to building the combined explain plan.
phoenix-core-client/src/main/java/org/apache/phoenix/execute/HashJoinPlan.javaPropagates ExplainOptions to each hash-join subplan’s inner plan context before rendering subplan explain steps/attributes.
phoenix-core-client/src/main/java/org/apache/phoenix/execute/ClientScanPlan.javaPushes wrapper context ExplainOptions down into the delegate plan context before delegating explain.
phoenix-core-client/src/main/java/org/apache/phoenix/execute/ClientAggregatePlan.javaPushes wrapper context ExplainOptions down into the delegate plan context before delegating explain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@apurtell
apurtell merged commit 3fe39c3 into apache:PHOENIX-7876-featureJun 25, 2026
@apurtell
apurtell deleted the PHOENIX-7935 branch June 25, 2026 00:34
asf-gitbox-commits pushed a commit that referenced this pull request Jul 24, 2026
…xts (#2544)
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
apurtell added a commit to apurtell/phoenix that referenced this pull request Aug 4, 2026
…xts (apache#2544)
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Sign up for freeto 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

@apurtell