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

Method map_children

datafusion/common/src/tree_node.rs:1288–1311  ·  view source on GitHub ↗
(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

1286 }
1287
1288 fn map_children<F: FnMut(Self) -> Result<Transformed<Self>>>(
1289 self,
1290 f: F,
1291 ) -> Result<Transformed<Self>> {
1292 let children = self.arc_children();
1293 if !children.is_empty() {
1294 let new_children = children
1295 .into_iter()
1296 .cloned()
1297 .map_until_stop_and_collect(f)?;
1298 // Propagate up `new_children.transformed` and `new_children.tnr`
1299 // along with the node containing transformed children.
1300 if new_children.transformed {
1301 let arc_self = Arc::clone(&self);
1302 new_children.map_data(|new_children| {
1303 self.with_new_arc_children(arc_self, new_children)
1304 })
1305 } else {
1306 Ok(Transformed::new(self, false, new_children.tnr))
1307 }
1308 } else {
1309 Ok(Transformed::no(self))
1310 }
1311 }
1312}
1313
1314/// Instead of implementing [`TreeNode`], it's recommended to implement a [`ConcreteTreeNode`] for

Callers 2

transform_down_implMethod · 0.45
transform_up_implMethod · 0.45

Calls 12

newFunction · 0.85
map_dataMethod · 0.80
update_dataMethod · 0.80
arc_childrenMethod · 0.45
is_emptyMethod · 0.45
clonedMethod · 0.45
into_iterMethod · 0.45
with_new_arc_childrenMethod · 0.45
take_childrenMethod · 0.45
with_new_childrenMethod · 0.45
map_elementsMethod · 0.45

Tested by

no test coverage detected