peter-toth commented on code in PR #13467: URL: https://github.com/apache/datafusion/pull/13467#discussion_r1848396994
########## datafusion/common/src/tree_node.rs: ########## @@ -769,6 +770,263 @@ impl<T> Transformed<T> { } } +/// [`Container`] contains elements that a function can be applied on or mapped. The +/// elements of the container are siblings so the continuation rules are similar to +/// [`TreeNodeRecursion::visit_sibling`] / [`Transformed::transform_sibling`]. +pub trait Container<'a, T: 'a>: Sized { + fn apply_elements<F: FnMut(&'a T) -> Result<TreeNodeRecursion>>( + &'a self, + f: F, + ) -> Result<TreeNodeRecursion>; + + fn map_elements<F: FnMut(T) -> Result<Transformed<T>>>( Review Comment: Sure, I added comments in https://github.com/apache/datafusion/pull/13467/commits/2097bc7603097f4106d68be9f1b6a281d4bdbb7e to clarify how these methods are used. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org