Skip to content

Commit

Permalink
Add additional docstring comments to from_plan
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Oct 23, 2021
1 parent e6657f0 commit f954e93
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion datafusion/src/optimizer/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,21 @@ pub fn optimize_children(
from_plan(plan, &new_exprs, &new_inputs)
}

/// Returns a new logical plan based on the original one with inputs and expressions replaced
/// Returns a new logical plan based on the original one with inputs
/// and expressions replaced.
///
/// The exprs correspond to the same order of expressions returned by
/// `LogicalPlan::expressions`. This function is used in optimizers in
/// the following way:
///
///
/// ```norun
/// let new_inputs = optimize_children(..., plan, props);
/// let exprs = plan.expressions();
/// // potentially rewrite exprs
/// let rewritten_exprs = rewrite_exprs(exprs);
/// let new_plan = from_plan(&plan, rewritten_exprs, new_inputs)
/// ```
pub fn from_plan(
plan: &LogicalPlan,
expr: &[Expr],
Expand Down

0 comments on commit f954e93

Please sign in to comment.