optimize_projections

Function optimize_projections 

Source
fn optimize_projections(
    plan: LogicalPlan,
    config: &dyn OptimizerConfig,
    indices: RequiredIndices,
) -> Result<Transformed<LogicalPlan>>
Expand description

Removes unnecessary columns (e.g. columns that do not appear in the output schema and/or are not used during any computation step such as expression evaluation) from the logical plan and its inputs.

§Parameters

  • plan: A reference to the input LogicalPlan to optimize.
  • config: A reference to the optimizer configuration.
  • indices: A slice of column indices that represent the necessary column indices for downstream (parent) plan nodes.

§Returns

A Result object with the following semantics:

  • Ok(Some(LogicalPlan)): An optimized LogicalPlan without unnecessary columns.
  • Ok(None): Signal that the given logical plan did not require any change.
  • Err(error): An error occurred during the optimization process.