Skip to content

Add schema-aware optimizer child rewrites#23686

Open
sakshichitnis27 wants to merge 1 commit into
apache:mainfrom
sakshichitnis27:issue/23666-schema-aware-child-rewrites
Open

Add schema-aware optimizer child rewrites#23686
sakshichitnis27 wants to merge 1 commit into
apache:mainfrom
sakshichitnis27:issue/23666-schema-aware-child-rewrites

Conversation

@sakshichitnis27

Copy link
Copy Markdown

Fixes #23666

Summary

  • Add an optimizer-local helper for schema-aware direct-child rewrites.
  • Recompute a parent schema only when a rewritten child’s schema changes.
  • Migrate EliminateCrossJoin to use the helper.
  • Preserve existing in-place optimizer schema protection.
  • Add tests for schema-changing and schema-preserving child rewrites.

This is an internal optimizer refactor and does not change SQL-visible behavior.

Testing

  • cargo fmt --all --check
  • cargo test -p datafusion-optimizer

The optimizer tests passed, including unit tests, integration tests, and doctests.
cargo clippy is currently blocked by an unrelated existing dead_code error in
datafusion-physical-expr.

@github-actions github-actions Bot added the optimizer Optimizer rules label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Add an optimizer-local helper for schema-aware child rewrites

1 participant