Skip to content

Commit

Permalink
Update tree_node.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
berkaysynnada committed Feb 29, 2024
1 parent 3841067 commit cb7f965
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions datafusion/common/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,17 @@ impl<T: ConcreteTreeNode> TreeNode for T {
let (new_self, children) = self.take_children();
if !children.is_empty() {
let new_children = children.into_iter().map_until_stop_and_collect(f)?;
// Propagate up `t.transformed` and `t.tnr` along with
// the node containing transformed children.
new_self.with_new_children(new_children.data)
if new_children.transformed {
// Propagate up `t.transformed` and `t.tnr` along with
// the node containing transformed children.
new_self.with_new_children(new_children.data)
} else {
Ok(Transformed::no(
new_self.with_new_children(new_children.data)?.data,
))
}
} else {
Ok(Transformed::no(new_self.with_new_children(children)?.data))
Ok(Transformed::no(new_self))
}
}
}
Expand Down

0 comments on commit cb7f965

Please sign in to comment.