Skip to content

PHOENIX-7927 Fix EXPLAIN plumbing related NPE in DelegateQueryPlan.setOptimizerDecision - #2532

Merged
apurtell merged 1 commit into
apache:PHOENIX-7876-featurefrom
apurtell:PHOENIX-7927
Jun 15, 2026
Merged

PHOENIX-7927 Fix EXPLAIN plumbing related NPE in DelegateQueryPlan.setOptimizerDecision#2532
apurtell merged 1 commit into
apache:PHOENIX-7876-featurefrom
apurtell:PHOENIX-7927

Conversation

@apurtell

@apurtell apurtell commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

NPE in DelegateQueryPlan.setOptimizerDecision because the delegate is null, via TotalSegmentsFunctionIT.

getApplicablePlansForSingleFlatQuery can call recordDecision on a DelegateQueryPlan with a null delegate. ClientProcessingPlan overrides getContext() / getTableRef() / getProjector() to use local fields, so a null delegate is fine except for the two optimizer-decision accessors that DelegateQueryPlan is forwarding unconditionally. This is a regression from PHOENIX-7891 that breaks any query involving TOTAL_SEGMENTS.

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

Copilot AI 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

Fixes a regression where DelegateQueryPlan.setOptimizerDecision() could throw an NPE during EXPLAIN plumbing when a DelegateQueryPlan is intentionally constructed with a null delegate (e.g., via ClientProcessingPlan in queries involving TOTAL_SEGMENTS).

Changes:

  • Add local fallback storage for OptimizerDecision in DelegateQueryPlan when no delegate is present.
  • Guard optimizer-decision getter/setter to forward to the delegate when non-null, otherwise use the fallback field.

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

@apurtell
apurtell merged commit 4a4ace8 into apache:PHOENIX-7876-feature Jun 15, 2026
@apurtell
apurtell deleted the PHOENIX-7927 branch June 15, 2026 15:41
apurtell added a commit to apurtell/phoenix that referenced this pull request Jun 17, 2026
…tOptimizerDecision (apache#2532)

Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
asf-gitbox-commits pushed a commit that referenced this pull request Jul 24, 2026
…tOptimizerDecision (#2532)

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
…tOptimizerDecision (apache#2532)

Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
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