rewrite_projection

Function rewrite_projection 

Source
fn rewrite_projection(
    predicates: Vec<Expr>,
    projection: Projection,
) -> Result<(Transformed<LogicalPlan>, Option<Expr>)>
Expand description

Attempts to push predicate into a FilterExec below `projection

§Returns

(plan, remaining_predicate)

plan is a LogicalPlan for projection with possibly a new FilterExec below it. remaining_predicate is any part of the predicate that could not be pushed down

§Args

  • predicates: Split predicates like [foo=5, bar=6]
  • projection: The target projection plan to push down the predicates

§Example

Pushing a predicate like foo=5 AND bar=6 with an input plan like this:

Projection(foo, c+d as bar)

Might result in returning remaining_predicate of bar=6 and a plan like

Projection(foo, c+d as bar)
 Filter(foo=5)
  ...