MCPcopy Create free account
hub / github.com/apache/datafusion / transform_down_up

Method transform_down_up

datafusion/common/src/tree_node.rs:366–392  ·  view source on GitHub ↗

Transforms the node using `f_down` while traversing the tree top-down (pre-order), and using `f_up` while traversing the tree bottom-up (post-order). The method behaves the same as calling [`Self::transform_down`] followed by [`Self::transform_up`] on the same node. Use this method if you want to start the `f_up` process right where `f_down` jumps. This can make the whole process faster by reduci

(
        self,
        mut f_down: FD,
        mut f_up: FU,
    )

Source from the content-addressed store, hash-verified

364 /// +---+
365 /// ```
366 fn transform_down_up<
367 FD: FnMut(Self) -> Result<Transformed<Self>>,
368 FU: FnMut(Self) -> Result<Transformed<Self>>,
369 >(
370 self,
371 mut f_down: FD,
372 mut f_up: FU,
373 ) -> Result<Transformed<Self>> {
374 #[cfg_attr(feature = "recursive_protection", recursive::recursive)]
375 fn transform_down_up_impl<
376 N: TreeNode,
377 FD: FnMut(N) -> Result<Transformed<N>>,
378 FU: FnMut(N) -> Result<Transformed<N>>,
379 >(
380 node: N,
381 f_down: &mut FD,
382 f_up: &mut FU,
383 ) -> Result<Transformed<N>> {
384 handle_transform_recursion!(
385 f_down(node),
386 |c| transform_down_up_impl(c, f_down, f_up),
387 f_up
388 )
389 }
390
391 transform_down_up_impl(self, &mut f_down, &mut f_up)
392 }
393
394 /// Returns true if `f` returns true for any node in the tree.
395 ///

Callers 2

unalias_nestedMethod · 0.80
optimizeMethod · 0.80

Implementers 3

tree_node.rsdatafusion/expr/src/tree_node.rs
tree_node.rsdatafusion/expr/src/logical_plan/tree_
tree_node.rsdatafusion/common/src/tree_node.rs

Calls

no outgoing calls

Tested by

no test coverage detected