Function datafusion::optimizer::utils::optimize_children

source ·
pub fn optimize_children(
    optimizer: &impl OptimizerRule,
    plan: &LogicalPlan,
    config: &dyn OptimizerConfig
) -> Result<Option<LogicalPlan>, DataFusionError>
Expand description

Convenience rule for writing optimizers: recursively invoke optimize on plan’s children and then return a node of the same type. Useful for optimizer rules which want to leave the type of plan unchanged but still apply to the children. This also handles the case when the plan is a LogicalPlan::Explain.

Returning Ok(None) indicates that the plan can’t be optimized by the optimizer.