Skip to content

sql: avoid duplicate projection-name errors in set-op operands#20833

Open
SergioChan wants to merge 1 commit intoapache:mainfrom
SergioChan:fix-setop-duplicate-literal-names
Open

sql: avoid duplicate projection-name errors in set-op operands#20833
SergioChan wants to merge 1 commit intoapache:mainfrom
SergioChan:fix-setop-duplicate-literal-names

Conversation

@SergioChan
Copy link

Summary

  • fix planning for set-operation operands (UNION / EXCEPT / INTERSECT) when a non-left operand has repeated unnamed projection literals
  • on duplicate projection-name planning errors for non-BY NAME set ops, retry the right operand with deterministic synthetic aliases so output naming still comes from the left side
  • add a regression test for SELECT 1 c1, 0 c2, 0 c3 UNION ALL SELECT 2, 0, 0

Testing

  • Not run locally in this environment (cargo is not installed here), so I could not execute the new test.

Related

Fixes #20818

@github-actions github-actions bot added the sql SQL Planner label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected set expression query planning error

1 participant