Expand description
Defines the projection execution plan. A projection determines which columns or expressions
are returned from a query. The SQL statement SELECT a, b, a+b FROM t1 is an example
of a projection on table t1 where the expressions a, b, and a+b are the
projection expressions. SELECT without FROM will only evaluate expressions.
Structs§
- Join
Data - Projection
Exec ExecutionPlanfor a projection- Projection
Expr - A projection expression as used by projection operations.
- Projection
Exprs - A collection of projection expressions.
Traits§
Functions§
- all_
alias_ free_ columns - Given the expression set of a projection, checks if the projection causes
any renaming or constructs a non-
Columnphysical expression. - all_
columns - Returns
trueif all the expressions in the argument areColumns. - join_
allows_ pushdown - Checks three conditions for pushing a projection down through a join:
- join_
table_ borders - Returns the last index before encountering a column coming from the right table when traveling through the projection from left to right, and the last index before encountering a column coming from the left table when traveling through the projection from right to left. If there is no column in the projection coming from the left side, it returns (-1, …), if there is no column in the projection coming from the right side, it returns (…, projection length).
- make_
with_ child - Creates a new
ProjectionExecinstance with the given child plan and projected expressions. - new_
join_ children - If pushing down the projection over this join’s children seems possible,
this function constructs the new
ProjectionExecs that will come on top of the original children of the join. - new_
projections_ for_ columns - Updates a source provider’s projected columns according to the given
projection operator’s expressions. To use this function safely, one must
ensure that all expressions are
Columnexpressions without aliases. - physical_
to_ column_ exprs - Downcasts all the expressions in
exprstoColumns. If any of the given expressions is not aColumn, returnsNone. - remove_
unnecessary_ projections - This function checks if
planis aProjectionExec, and inspects its input(s) to test whether it can pushplanunder its input(s). This function will operate on the entire tree and may ultimately removeplanentirely by leveraging source providers with built-in projection capabilities. - try_
embed_ projection - Some projection can’t be pushed down left input or right input of hash join because filter or on need may need some columns that won’t be used in later. By embed those projection to hash join, we can reduce the cost of build_batch_from_indices in hash join (build_batch_from_indices need to can compute::take() for each column) and avoid unnecessary output creation.
- try_
pushdown_ through_ join - update_
expr - The function operates in two modes:
- update_
join_ filter - Tries to update the column indices of a
JoinFilteras if the input of the join was replaced by a projection. - update_
join_ on - Tries to update the equi-join
Column’s of a join as if the input of the join was replaced by a projection. - update_
ordering - Updates the given lexicographic ordering according to given projected
expressions using the
update_exprfunction. - update_
ordering_ requirement - Updates the given lexicographic requirement according to given projected
expressions using the
update_exprfunction.