You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "msaule (via GitHub)" <gi...@apache.org> on 2026/08/03 23:11:55 UTC
[PR] fix: reject duplicate projection output names [datafusion]
msaule opened a new pull request, #24073:
URL: https://github.com/apache/datafusion/pull/24073
## Which issue does this PR close?
- Closes #21246.
## 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: reject duplicate projection output names [datafusion]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #24073: fix: reject duplicate projection output names
URL: https://github.com/apache/datafusion/pull/24073
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: reject duplicate projection output names [datafusion]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24073:
URL: https://github.com/apache/datafusion/pull/24073#issuecomment-5259366275
<!-- semver-check-comment -->
Thank you for opening this pull request!
Reviewer note: [cargo-semver-checks](https://github.com/obi1kenobi/cargo-semver-checks) reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).
<details>
<summary>Details</summary>
```
Cloning apache/main
Building datafusion-physical-plan v54.1.0 (current)
Built [ 43.979s] (current)
Parsing datafusion-physical-plan v54.1.0 (current)
Parsed [ 0.141s] (current)
Building datafusion-physical-plan v54.1.0 (baseline)
Built [ 38.130s] (baseline)
Parsing datafusion-physical-plan v54.1.0 (baseline)
Parsed [ 0.143s] (baseline)
Checking datafusion-physical-plan v54.1.0 -> v54.1.0 (no change; assume patch)
Checked [ 0.637s] 223 checks: 217 pass, 6 fail, 0 warn, 30 skip
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/function_missing.ron
Failed in:
function datafusion_physical_plan::execution_plan::apply_expression_roots, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:980
function datafusion_physical_plan::apply_expression_roots, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:980
--- failure function_parameter_count_changed: pub fn parameter count changed ---
Description:
A publicly-visible function now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/function_parameter_count_changed.ron
Failed in:
datafusion_physical_plan::windows::get_best_fitting_window now takes 3 parameters instead of 4, in /home/runner/work/datafusion/datafusion/datafusion/physical-plan/src/windows/mod.rs:592
--- failure inherent_method_missing: pub method removed or renamed ---
Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/inherent_method_missing.ron
Failed in:
BoundedWindowAggExec::with_state_observer, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:223
BoundedWindowAggExec::state_observer, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:249
MockExec::with_unknown_statistics, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/test/exec.rs:167
ProjectionExec::try_new_with_schema_metadata, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/projection.rs:157
--- failure struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/struct_missing.ron
Failed in:
struct datafusion_physical_plan::repartition::RangeExpr, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/repartition/mod.rs:657
--- failure trait_method_missing: pub trait method removed or renamed ---
Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/trait_method_missing.ron
Failed in:
method dynamic_expressions_produced of trait ExecutionPlan, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:184
method apply_expressions of trait ExecutionPlan, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:329
method dynamic_expressions_produced of trait ExecutionPlan, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:184
method apply_expressions of trait ExecutionPlan, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:329
--- failure trait_missing: pub trait removed or renamed ---
Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/trait_missing.ron
Failed in:
trait datafusion_physical_plan::windows::WindowStateObserver, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:92
trait datafusion_physical_plan::execution_plan::AsPhysicalExprRef, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:943
trait datafusion_physical_plan::AsPhysicalExprRef, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/347812e66c15c6420f5755edc94f0725e67bfe66/datafusion/physical-plan/src/execution_plan.rs:943
Summary semver requires new major version: 6 major and 0 minor checks failed
Finished [ 84.452s] datafusion-physical-plan
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: reject duplicate projection output names [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #24073:
URL: https://github.com/apache/datafusion/pull/24073#issuecomment-5225798284
This approach looks good to me -- thank you @msaule
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: reject duplicate projection output names [datafusion]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24073:
URL: https://github.com/apache/datafusion/pull/24073#issuecomment-6104393923
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org