Skip to content

fix: reject duplicate projection output names - #24073

Draft
msaule wants to merge 1 commit into
apache:mainfrom
msaule:fix-projection-duplicate-alias-invariant
Draft

fix: reject duplicate projection output names#24073
msaule wants to merge 1 commit into
apache:mainfrom
msaule:fix-projection-duplicate-alias-invariant

Conversation

@msaule

@msaule msaule commented Aug 3, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

ProjectionExec can currently be constructed with duplicate output aliases. This violates DataFusion's unique-column-name invariant and makes name-based physical-plan rewrites, including filter pushdown, ambiguous and capable of producing incorrect results.

What changes are included in this PR?

  • Reject duplicate output column names in ProjectionExec::try_new with a planning error.
  • Add a regression test that constructs a projection with duplicate aliases and verifies the error.

Are these changes tested?

  • cargo test -p datafusion-physical-plan --lib
  • cargo clippy -p datafusion-physical-plan --all-targets --all-features -- -D warnings

Are there any user-facing changes?

Physical-plan API users that construct a ProjectionExec with duplicate output aliases now receive a planning error instead of an ambiguous plan. SQL planning already enforces unique names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FilterPushdown physical optimizer incorrectly remaps filters through ProjectionExec with duplicate column names

1 participant