Function datafusion_physical_expr::utils::find_orderings_of_exprs
source · pub fn find_orderings_of_exprs(
expr: &[(Arc<dyn PhysicalExpr>, String)],
input_output_ordering: Option<&[PhysicalSortExpr]>,
input_equal_properties: EquivalenceProperties,
input_ordering_equal_properties: OrderingEquivalenceProperties
) -> Result<Vec<Option<PhysicalSortExpr>>>
Expand description
Calculates the output orderings for a set of expressions within the context of a given
execution plan. The resulting orderings are all in the type of Column
, since these
expressions become Column
after the projection step. The expressions having an alias
are renamed with those aliases in the returned PhysicalSortExpr
’s. If an expression
is found to be unordered, the corresponding entry in the output vector is None
.
Arguments
-
expr
- A slice of tuples containing expressions and their corresponding aliases. -
input_output_ordering
- Output ordering of the input plan. -
input_equal_properties
- Equivalence properties of the columns in the input plan. -
input_ordering_equal_properties
- Ordering equivalence properties of the columns in the input plan.
Returns
A Result
containing a vector of optional PhysicalSortExpr
’s. Each element of the
vector corresponds to an expression from the input slice. If an expression can be ordered,
the corresponding entry is Some(PhysicalSortExpr)
. If an expression cannot be ordered,
the entry is None
.