peter-toth commented on code in PR #7942:
URL: https://github.com/apache/arrow-datafusion/pull/7942#discussion_r1432836976
##########
datafusion/common/src/tree_node.rs:
##########
@@ -289,15 +492,80 @@ pub enum RewriteRecursion {
Skip,
}
-/// Controls how the [`TreeNode`] recursion should proceed for
[`TreeNode::visit`].
+/// Controls how the [`TreeNode`] recursion should proceed for
[`TreeNode::visit_down()`] and
+/// [`TreeNode::visit()`].
#[derive(Debug)]
-pub enum VisitRecursion {
- /// Continue the visit to this node tree.
+pub enum TreeNodeRecursion {
+ /// Continue the visit to the next node.
Continue,
- /// Keep recursive but skip applying op on the children
- Skip,
- /// Stop the visit to this node tree.
+
+ /// Prune the current subtree.
+ /// If a preorder visit of a tree node returns
[`TreeNodeRecursion::Prune`] then inner
+ /// children and children will not be visited and postorder visit of the
node will not
+ /// be invoked.
+ Prune,
Review Comment:
We can keep `Skip` if you prefer. (To me `Prune` better describes that
children should not be visited.)
--
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]