peter-toth commented on PR #8891:
URL: 
https://github.com/apache/arrow-datafusion/pull/8891#issuecomment-1933999959

   > That example is for pre_visit & post_visit API. To be more concrete, you 
can think of the context of `transform_up()`. If `op` is called on "A", and it 
returns "Jump", then `op` will be called on "H".
   
   Yeah, I got it. I just wanted to see it from a bottom-up traversal 
perspective.
   
   > For your question, I am not sure that if post_visit(A) returns Jump, then 
we should continue with pre_visit(G) or post_visit(H). What do you suggest for 
it, considering the behavior of Jump in `transform_up()`?
   
   `pre_visit(G)` is much easier to follop-up with, otherwise for 
`post_visit(H)` you need to propagate down some state (from `F`) to skip nodes 
till a leaf (`H`) is reached.
   To continue with `pre_visit(G)` you just need to propagate up `Jump` and 
handle it in `F` as `Continue`.
   Listen, I don't want to block this feature if you think this is useful. I 
suggest you to open a PR targeting my PR to add this extra functionality. I 
suspect that this will complicate the code as you need to handle `Jump` in 
nodes considering if any sibling remained to visit.
   For the exampe to do some processing on leaves only I would just write a 
simple `transform_up` with a closure that check if the current node is leaf or 
not and simply continue with `Continue`. This would be as effective as using 
`Jump`s.


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

Reply via email to