zhuqi-lucas commented on PR #22521:
URL: https://github.com/apache/datafusion/pull/22521#issuecomment-4551900016

   Thanks for the review @2010YOUY01! Good catch on #19792 — I had not noticed 
that one.
   
   I just pushed two updates:
   
   1. **Switched to the existing `with_new_children_if_necessary` helper** 
(`datafusion_physical_plan::with_new_children_if_necessary`). Same behavior, 
fewer lines, keeps the optimization in one canonical place.
   2. **Added a regression test** 
(`ensure_distribution_reuses_plan_arc_when_no_redistribution_needed`) that 
asserts `Arc::ptr_eq(result, input)` on a deep ProjectionExec chain over a 
single-partition scan — guards the fast path against future refactors.
   
   Re: the clippy lint to disallow direct `with_new_children()` usage 
project-wide — happy to take that as a follow-up PR. As you note it's a much 
larger change since every existing call site would need to switch to the 
helper, and I'd want to do it separately so this PR stays focused on the 
distribution rule.
   
   Latest commits: 28a92a5cd (refactor) + b5beced67 (test).


-- 
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