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

Method map_children

datafusion/expr/src/logical_plan/tree_node.rs:72–356  ·  view source on GitHub ↗

Applies `f` to each child (input) of this plan node, rewriting them *in place. # Notes Inputs include ONLY direct children, not embedded `LogicalPlan`s for subqueries, for example such as are in [`Expr::Exists`]. [`Expr::Exists`]: crate::Expr::Exists

(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

70 ///
71 /// [`Expr::Exists`]: crate::Expr::Exists
72 fn map_children<F: FnMut(Self) -> Result<Transformed<Self>>>(
73 self,
74 f: F,
75 ) -> Result<Transformed<Self>> {
76 Ok(match self {
77 LogicalPlan::Projection(Projection {
78 expr,
79 input,
80 schema,
81 }) => input.map_elements(f)?.update_data(|input| {
82 LogicalPlan::Projection(Projection {
83 expr,
84 input,
85 schema,
86 })
87 }),
88 LogicalPlan::Filter(Filter { predicate, input }) => input
89 .map_elements(f)?
90 .update_data(|input| LogicalPlan::Filter(Filter { predicate, input })),
91 LogicalPlan::Repartition(Repartition {
92 input,
93 partitioning_scheme,
94 }) => input.map_elements(f)?.update_data(|input| {
95 LogicalPlan::Repartition(Repartition {
96 input,
97 partitioning_scheme,
98 })
99 }),
100 LogicalPlan::Window(Window {
101 input,
102 window_expr,
103 schema,
104 }) => input.map_elements(f)?.update_data(|input| {
105 LogicalPlan::Window(Window {
106 input,
107 window_expr,
108 schema,
109 })
110 }),
111 LogicalPlan::Aggregate(Aggregate {
112 input,
113 group_expr,
114 aggr_expr,
115 schema,
116 }) => input.map_elements(f)?.update_data(|input| {
117 LogicalPlan::Aggregate(Aggregate {
118 input,
119 group_expr,
120 aggr_expr,
121 schema,
122 })
123 }),
124 LogicalPlan::Sort(Sort { expr, input, fetch }) => input
125 .map_elements(f)?
126 .update_data(|input| LogicalPlan::Sort(Sort { expr, input, fetch })),
127 LogicalPlan::Join(Join {
128 left,
129 right,

Calls 15

ProjectionClass · 0.85
RepartitionClass · 0.85
WindowClass · 0.85
AggregateClass · 0.85
JoinClass · 0.85
LimitClass · 0.85
SubqueryClass · 0.85
SubqueryAliasClass · 0.85
rewrite_extension_inputsFunction · 0.85
ExplainClass · 0.85
AnalyzeClass · 0.85
CreateMemoryTableClass · 0.85

Tested by

no test coverage detected