Add schema-aware optimizer child rewrites - #23686
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23686 +/- ##
==========================================
- Coverage 80.75% 80.75% -0.01%
==========================================
Files 1096 1096
Lines 373588 373642 +54
Branches 373588 373642 +54
==========================================
+ Hits 301691 301719 +28
- Misses 53896 53902 +6
- Partials 18001 18021 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
@sakshichitnis27
Thanks for working on this.
Could we consider migrating remaining owned-child rewrite path in datafusion/optimizer/src/optimize_projections/mod.rs' fn optimize_projections
// Rewrite children of the plan
let transformed_plan = plan.map_children(|child| {to map_children_recompute_schema_if_needed in a follow-up, while keeping the separate optimize_subqueries handling?
It currently uses a manual map_children followed by an unconditional recompute_schema() whenever a transformation occurs. Using the new helper would keep the child-schema cache invariant more consistently owned by one API, and it may also avoid unnecessary recomputes when a child's internals change without affecting its schema.
Fixes #23666
Summary
EliminateCrossJointo use the helper.This is an internal optimizer refactor and does not change SQL-visible behavior.
Testing
cargo fmt --all --checkcargo test -p datafusion-optimizerThe optimizer tests passed, including unit tests, integration tests, and doctests.
cargo clippyis currently blocked by an unrelated existingdead_codeerror indatafusion-physical-expr.