Skip to content

fix: preserve projection field metadata during physical planning - #23981

Open
subotac wants to merge 1 commit into
apache:mainfrom
subotac:fix/projection-field-metadata
Open

fix: preserve projection field metadata during physical planning#23981
subotac wants to merge 1 commit into
apache:mainfrom
subotac:fix/projection-field-metadata

Conversation

@subotac

@subotac subotac commented Jul 29, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Logical projection aliases can attach field metadata, but physical projection planning derived its output schema only from the unwrapped physical expressions. This caused schema validation to reject
aggregates above such projections.

What changes are included in this PR?

  • Apply logical projection schema and field metadata when constructing ProjectionExec.
  • Preserve the existing physical derivation of field names, types, and nullability.
  • Add metadata-aware constructors across the physical-expression and physical-plan crate boundary.
  • Cover projections with alias metadata followed by aggregation.

Are these changes tested?

Yes. A focused physical planner regression test reproduces the original schema mismatch and passes with the fix. The relevant core and physical-plan unit suites, targeted all-targets/all-features
clippy, formatting, and diff checks also pass.

Are there any user-facing changes?

Projection field metadata is now preserved in physical plans. Two additive constructor methods support passing projection schema metadata across crate boundaries; no existing API is changed.

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates core Core DataFusion crate physical-plan Changes to the physical-plan crate labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing field metadata for projections during physical planning

1 participant