Toby1009 opened a new pull request, #25685:
URL: https://github.com/apache/datafusion/pull/25685

   ## Which issue does this PR close?
   
   Closes #25680.
   
   ## Rationale for this change
   
   `EliminateCrossJoin` walks the inner-join subtree twice before rebuilding 
it. Both callers of `can_flatten_join_inputs` already establish an inner-join 
root, and the helper only recurses into inner-join children, so the precheck 
always succeeds at these call sites.
   
   Removing it avoids the redundant traversal and the need to keep two 
traversal implementations in sync, while preserving the existing optimized 
plans.
   
   ## What changes are included in this PR?
   
   - Remove `can_flatten_join_inputs` and its two call-site guards.
   - Make the private `flatten_join_inputs` helper infallible and update its 
documentation. Keep filter collection, non-inner join boundaries, and 
child/subquery rewriting unchanged.
   - Add a focused plan test for preserving a left-join subtree and its filter 
beneath an inner join, including the inner join's residual filter and output 
schema.
   - Fix two existing Clippy warnings in `multi_group_by.rs` to pass the 
required local checks.
   
   ## What is the testing strategy for this PR?
   
   - All 26 `eliminate_cross_join` tests passed, including 
`preserve_outer_join_boundary`.
   - Extended workspace tests passed: 12,112 tests passed, 8 ignored, and all 
523 sqllogictest files completed successfully.
   - `cargo fmt --all`, `cargo clippy --all-targets --all-features -- -D 
warnings`, and `uv run ./dev/rust_lint.sh` passed.
   - Compared the existing six-table self-join and no-join SQL planning 
workloads against `main` using a temporary Criterion harness. Across three 
alternating rounds, physical plans matched and no consistent end-to-end speedup 
was observed; six-table planning stayed around 4.9 ms. This is a 
maintainability refactor without a measured performance improvement claim.
   
   ## Are there any user-facing changes?
   
   No SQL behavior or public API changes.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to