blaginin commented on code in PR #13177:
URL: https://github.com/apache/datafusion/pull/13177#discussion_r1834757485


##########
datafusion/common/src/tree_node.rs:
##########
@@ -937,6 +943,28 @@ impl<T> TransformedResult<T> for Result<Transformed<T>> {
     }
 }
 
+/// A node trait which makes all tree traversal iterative and not recursive.
+pub trait RecursiveNode: Sized {
+    /// Read-only access to children
+    fn children(&self) -> Vec<&Self>;
+
+    /// Detaches children from the parent node (if possible).
+    /// Unlike [`ConcreteTreeNode`] it doesn't possible that the value will 
actually be removed from the parent
+    fn take_children(self) -> (Self, Vec<Self>);

Review Comment:
   I removed `RecursiveNode` in 
https://github.com/apache/datafusion/pull/13177/commits/403230aafcad9f75f806b56a2d5c0848b6c3a4c5
 by moving its logic into ConcreteTreeNode (though I’m not sure if this could 
be done directly in TreeNode). 
   
   I also linked `DynTreeNode` and `ConcreteTreeNode`. This change might be 
debatable, so I’m happy to discuss further if needed :)



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to