peter-toth commented on PR #8664: URL: https://github.com/apache/arrow-datafusion/pull/8664#issuecomment-1879992612
Thanks for the update @ozankabak. As regards to 1. https://github.com/apache/arrow-datafusion/pull/7942 and our discussion with @berkaysynnada at https://github.com/apache/arrow-datafusion/issues/8663#issuecomment-1871218567 might be relevant. Although that PR didn't try to eliminate code duplication, it might be useful to design better tree visit/transform functions in terms of effectiveness (self mutation of nodes where possible) and API usability (common `TreeNodeRecursion` enum results to control recursions). I think 2. is somewhat orthogonal to 1., the new `transformWithPayload` functions of this PR depend on `map_children` only. I beleive whatever will be the alternative of `map_children` after you simplification the code of this PR can be adjusted easily. (Actually, the original version in https://github.com/apache/arrow-datafusion/pull/7942 did use mutable references to nodes but this separate PR alligns with the current consume and produce way of other `TreeNode` APIs.) You might have seen that yesterday I pushed another commit to this PR: https://github.com/apache/arrow-datafusion/pull/8664/commits/88a43c10ec65ea04ea56514af546b9cbf20d77d4 to refactor and remove `PlanWithCorrespondingCoalescePartitions` using `transform_with_payload()`. The change is very similar to the previous `OrderPreservationContext` related one. The new algorightm not just removes the derived tree, but also offers a more effective one pass transformation. If you have some time after your simplification a review of this PR would be greatly appreciated as I would like to continue working on refactoring the remaining derived trees (either in this PR or follow-up ones). -- 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]
