Skip to content

fix: optimize_projections failure after mark joins created by EXISTS OR EXISTS#21265

Open
buraksenn wants to merge 2 commits intoapache:mainfrom
buraksenn:fix-optimize-projections-fail
Open

fix: optimize_projections failure after mark joins created by EXISTS OR EXISTS#21265
buraksenn wants to merge 2 commits intoapache:mainfrom
buraksenn:fix-optimize-projections-fail

Conversation

@buraksenn
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Issue has details but main problem is mark columns from LeftMark joins leak into parent join schemas, causing optimize_projections optimizer to fail.

What changes are included in this PR?

Add a projection after embedded subquery decorrelation to strip mark columns, following the same pattern as scalar_subquery_to_join. I've seen this projection is merged in the final plan.

Are these changes tested?

Added test case for reported failure

Are there any user-facing changes?

No.

@github-actions github-actions bot added the optimizer Optimizer rules label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

optimize_projections fails after mark-join involved

1 participant