Skip to content

Preserve projection metadata across data source pushdown - #73

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
preserve-projection-metadata
Sep 7, 2026
Merged

Preserve projection metadata across data source pushdown#73
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
preserve-projection-metadata

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • keep an explicit ProjectionExec when a data source pushdown cannot preserve its exact output schema
  • protect Arrow schema and field metadata from being dropped during projection pushdown
  • add a regression test for metadata-bearing projections over MemorySourceConfig

Why

DataSource::try_swapping_with_projection receives projection expressions but not the projection output schema. A source can therefore absorb an otherwise identity projection while dropping field metadata. The physical optimizer then changes the planned schema and fails its invariant check.

The guard is conservative: normal pushdown is unchanged when the resulting schema is identical.

Validation

  • cargo +1.95.0 test --offline -p datafusion --test core_integration physical_optimizer::projection_pushdown (24 passed)
  • cargo +1.95.0 clippy --offline -p datafusion-datasource --lib -p datafusion --test core_integration
  • cargo +1.95.0 fmt --all -- --check

@osipovartem
osipovartem merged commit 2500f9c into embucket-sync-df55.0.0 Sep 7, 2026
16 checks passed
@osipovartem
osipovartem deleted the preserve-projection-metadata branch September 7, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant