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 - Execution plan for a projection
Traits§
Functions§
- all_
alias_ free_ columns - Given the expression set of a projection, checks if the projection causes
any renaming or constructs a non-
Column
physical expression. - all_
columns - Returns
true
if all the expressions in the argument areColumn
s. - 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
ProjectionExec
instance 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
ProjectionExec
s 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
Column
expressions without aliases. - physical_
to_ column_ exprs - Downcasts all the expressions in
exprs
toColumn
s. If any of the given expressions is not aColumn
, returnsNone
. - remove_
unnecessary_ projections - This function checks if
plan
is aProjectionExec
, and inspects its input(s) to test whether it can pushplan
under its input(s). This function will operate on the entire tree and may ultimately removeplan
entirely 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
JoinFilter
as 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.