peter-toth commented on PR #8891: URL: https://github.com/apache/arrow-datafusion/pull/8891#issuecomment-1896028558
> > This is correct. This is because the proposed new `transform()` does only one traversal. It is exactly the same order how the old and new `TreeNode::rewrite` / `TreeNodeRewriter` worked and works. > > I checked again. Yes, the order is correct. What I really meant is that when we use `transform()`, it is assumed that we first pass from top to bottom and then from bottom to top. But if we want to do the opposite, i.e. first from bottom to top and then from top to bottom, we cannot use this `transform()`, am I right?. That's correct. I don't think that botom-up and then top-down can't be achieved in one run. > Since the nodes access their children, first top-down and then bottom-up traversals seem to be a single pass, doing it in reverse order is like 2 passes, but as a behavior, it may be desirable to have reverse order and should we provide a way for this? API users can explicitly call `transform_up()` and then `transform_down()` (2 pass) if this is needed. Do you have a real use case for this? -- 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]
