Module projection

Source
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§

JoinData
ProjectionExec
Execution plan for a projection

Traits§

EmbeddedProjection

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 are Columns.
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 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 Column expressions without aliases.
physical_to_column_exprs
Downcasts all the expressions in exprs to Columns. If any of the given expressions is not a Column, returns None.
remove_unnecessary_projections
This function checks if plan is a ProjectionExec, and inspects its input(s) to test whether it can push plan under its input(s). This function will operate on the entire tree and may ultimately remove plan 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.

Type Aliases§

JoinOn
The on clause of the join, as vector of (left, right) columns.
JoinOnRef
Reference for JoinOn.