File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,25 @@ pub fn optimize_children(
111
111
from_plan ( plan, & new_exprs, & new_inputs)
112
112
}
113
113
114
- /// Returns a new logical plan based on the original one with inputs and expressions replaced
114
+ /// Returns a new logical plan based on the original one with inputs
115
+ /// and expressions replaced.
116
+ ///
117
+ /// The exprs correspond to the same order of expressions returned by
118
+ /// `LogicalPlan::expressions`. This function is used in optimizers in
119
+ /// the following way:
120
+ ///
121
+ /// ```text
122
+ /// let new_inputs = optimize_children(..., plan, props);
123
+ ///
124
+ /// // get the plans expressions to optimize
125
+ /// let exprs = plan.expressions();
126
+ ///
127
+ /// // potentially rewrite plan expressions
128
+ /// let rewritten_exprs = rewrite_exprs(exprs);
129
+ ///
130
+ /// // create new plan using rewritten_exprs in same position
131
+ /// let new_plan = from_plan(&plan, rewritten_exprs, new_inputs);
132
+ /// ```
115
133
pub fn from_plan (
116
134
plan : & LogicalPlan ,
117
135
expr : & [ Expr ] ,
You can’t perform that action at this time.
0 commit comments