This function returns all Arc<dyn PhysicalExpr>
s inside the given
PhysicalSortExpr
sequence.
Compare the two expr lists are equal no matter the order.
For example two InListExpr can be considered to be equals no matter the order:
Strictly compare the two expr lists are equal in the given order.
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
.
Find the finer requirement among req1
and req2
If None
, this means that req1
and req2
are not compatible
e.g there is no requirement that satisfies both
This function finds the indices of targets
within items
using strict
equality.
This function finds the indices of targets
within items
, taking into
account equivalences according to equal_properties
.
Attempts to find a full match between the required columns to be ordered (lexicographically), and
the provided sort options (lexicographically), while considering equivalence properties.
This function maps back requirement after ProjectionExec
to the Executor for its input.
This function normalizes oeq_classes
expressions according to eq_properties
.
More explicitly, it makes sure that expressions in oeq_classes
are head entries
in eq_properties
, replacing any non-head entries with head entries if necessary.
Normalize the output expressions based on Columns Map.
Transform sort_exprs
vector, to standardized version using eq_properties
and ordering_eq_properties
Assume eq_properties
states that Column a
and Column b
are aliases.
Also assume ordering_eq_properties
states that ordering vec![d ASC]
and vec![a ASC, c ASC]
are
ordering equivalent (in the sense that both describe the ordering of the table).
If the sort_exprs
input to this function were vec![b ASC, c ASC]
,
This function converts sort_exprs
vec![b ASC, c ASC]
to first vec![a ASC, c ASC]
after considering eq_properties
Then converts vec![a ASC, c ASC]
to vec![d ASC]
after considering ordering_eq_properties
.
Standardized version vec![d ASC]
is used in subsequent operations.
This function applies the [normalize_sort_expr_with_equivalence_properties
]
function for all sort expressions in sort_exprs
and returns a vector of
normalized sort expressions.
Transform sort_reqs
vector, to standardized version using eq_properties
and ordering_eq_properties
Assume eq_properties
states that Column a
and Column b
are aliases.
Also assume ordering_eq_properties
states that ordering vec![d ASC]
and vec![a ASC, c ASC]
are
ordering equivalent (in the sense that both describe the ordering of the table).
If the sort_reqs
input to this function were vec![b Some(ASC), c None]
,
This function converts sort_exprs
vec![b Some(ASC), c None]
to first vec![a Some(ASC), c None]
after considering eq_properties
Then converts vec![a Some(ASC), c None]
to vec![d Some(ASC)]
after considering ordering_eq_properties
.
Standardized version vec![d Some(ASC)]
is used in subsequent operations.
Checks whether given ordering requirements are satisfied by provided
PhysicalSortExprs.
Re-assign column indices referenced in predicate according to given schema.
This may be helpful when dealing with projections.
Reverses the ORDER BY expression, which is useful during equivalent window
expression construction. For instance, ‘ORDER BY a ASC, NULLS LAST’ turns into
‘ORDER BY a DESC, NULLS FIRST’.
Scatter truthy
array by boolean mask. When the mask evaluates true
, next values of truthy
are taken, when the mask evaluates false
values null values are filled.
Assume the predicate is in the form of CNF, split the predicate to a Vec of PhysicalExprs.