alamb commented on issue #9637: URL: https://github.com/apache/arrow-datafusion/issues/9637#issuecomment-2017774865
> so I don't understand why the former one is better, I guess they have the similar performance. I was having trouble actually implementing the required TreeNode API for `&mut LogicalPlan` -- I can't remember the actual compiler error. I don't think they will differ in performance > I think a `LogicalPlan` tree is made of `Arc` links between the nodes currently. So I wonder if obtaining mutable references to a `LogicalPlan` node's children is possible at all without cloning the children first? Yes, I was able to do so (see the horrible code here to do it): https://github.com/apache/arrow-datafusion/pull/9708/files#diff-f69e720234d9da6cb3a4a178d3a5575fcd34f68191335a8c2465a172e8c4e6f1R498-R538 I also verified that it was actually unwrapping `Arc`s most of the time (not cloning) > (I.e. can we implement this todo https://github.com/apache/arrow-datafusion/pull/9780/files#diff-9619441d9605f143a911319cea75ae5192e6c5b17acfcbc17a3c73a9e32a8e61R138 effectively?) I tried to implement this API and it was not going well. However, implementing a `TreeNodeMutator` (similar to `TreeNodeRewriter` but that took a `mut &T` rather than `T`) seems to be more promsising. I am traveling this week so I won't have as much time as I would like to work on this, but I hope to push some more progress to https://github.com/apache/arrow-datafusion/pull/9780 soon -- 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]
