Expand description
Expression utilities
Enums§
- Aggregate
Order Sensitivity - Represents the sensitivity of an aggregate expression to ordering.
Constants§
- COUNT_
STAR_ EXPANSION - The value to which
COUNT(*)is expanded to inCOUNT(<constant>)expressions The value to whichCOUNT(*)is expanded to inCOUNT(<constant>)expressions
Functions§
- add_
filter - Returns a new LogicalPlan that filters the output of
planwith a LogicalPlan::Filter with allpredicatesANDed. - can_
hash - Can this data type be used in hash join equal conditions?? Data types here come from function ‘equal_rows’, if more data types are supported in create_hashes, add those data types here to generate join logical plan.
- check_
all_ columns_ from_ schema - Check whether all columns are from the schema.
- check_
grouping_ 🔒set_ size_ limit - check the number of expressions contained in the grouping_set
- check_
grouping_ 🔒sets_ size_ limit - check the number of grouping_set contained in the grouping sets
- collect_
subquery_ cols - Determine the set of
Columns produced by the subquery. - columnize_
expr - Convert an expression into Column expression if it’s already provided as input plan.
- compare_
sort_ expr - Compare the sort expr as PostgreSQL’s common_prefix_cmp(): https://github.com/postgres/postgres/blob/master/src/backend/optimizer/plan/planner.c
- conjunction
- Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical AND.
- cross_
join_ 🔒grouping_ sets - Compute the cross product of two grouping_sets
- disjunction
- Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical OR.
- enumerate_
grouping_ sets - Convert multiple grouping expressions into one
GroupingSet::GroupingSets,
if the grouping expression does not containExpr::GroupingSetor only has one expression,
no conversion will be performed. - exclude_
using_ 🔒columns - For each column specified in the USING JOIN condition, the JOIN plan outputs it twice (once for each join side), but an unqualified wildcard should include it only once. This function returns the columns that should be excluded.
- expand_
qualified_ wildcard - Resolves an
Expr::Wildcardto a collection of qualifiedExpr::Column’s. - expand_
wildcard - Resolves an
Expr::Wildcardto a collection ofExpr::Column’s. - expr_
as_ column_ expr - Convert any
Exprto anExpr::Column. - expr_
to_ columns - Recursively walk an expression tree, collecting the unique set of columns referenced in the expression
- exprlist_
to_ fields - Create schema fields from an expression list, for use in result set schema construction
- find_
aggregate_ exprs - Collect all deeply nested
Expr::AggregateFunction. They are returned in order of occurrence (depth first), with duplicates omitted. - find_
column_ exprs - Collect all deeply nested
Expr::Column’s. They are returned in order of appearance (depth first), and may contain duplicates. - find_
column_ 🔒indexes_ referenced_ by_ expr - Recursively walk an expression tree, collecting the column indexes referenced in the expression
- find_
columns_ 🔒referenced_ by_ expr - find_
exprs_ 🔒in_ expr - Search an
Expr, and all of its nestedExpr’s, for any that pass the provided test. The returnedExpr’s are deduplicated and returned in order of appearance (depth first). todo: document about that columns may refer to a lambda parameter? - find_
exprs_ 🔒in_ exprs - Search the provided
Expr’s, and all of their nestedExpr, for any that pass the provided test. The returnedExpr’s are deduplicated and returned in order of appearance (depth first). - find_
join_ exprs - Looks for correlating expressions: for example, a binary expression with one field from the subquery, and one not in the subquery (closed upon from outer scope)
- find_
out_ reference_ exprs - Collect all deeply nested
Expr::OuterReferenceColumn. They are returned in order of occurrence (depth first), with duplicates omitted. - find_
valid_ equijoin_ key_ pair - Give two sides of the equijoin predicate, return a valid join key pair. If there is no valid join key pair, return None.
- find_
window_ exprs - Collect all deeply nested
Expr::WindowFunction. They are returned in order of occurrence (depth first), with duplicates omitted. - format_
state_ name - Build state name. State is the intermediate state of the aggregate function.
- generate_
signature_ error_ msg - Creates a detailed error message for a function with wrong signature.
- generate_
sort_ key - Generate a sort key for a given window expr’s partition_by and order_by expr
- get_
excluded_ 🔒columns - Find excluded columns in the schema, if any
SELECT * EXCLUDE(col1, col2), would return
vec![col1, col2] - get_
exprs_ 🔒except_ skipped - Returns all
Exprs in the schema, except theColumns in thecolumns_to_skip - group_
window_ expr_ by_ sort_ keys - Group a slice of window expression expr by their order by expressions
- grouping_
set_ expr_ count - Count the number of distinct exprs in a list of group by expressions. If the
first element is a
GroupingSetexpression then it must be the only expr. - grouping_
set_ to_ exprlist - Find all distinct exprs in a list of group by expressions. If the
first element is a
GroupingSetexpression then it must be the only expr. - inspect_
expr_ pre - Recursively inspect an
Exprand all its children. todo: document about that columns may refer to a lambda parameter? - iter_
conjunction - Iterate parts in a conjunctive
Exprsuch asA AND B AND C=>[A, B, C] - iter_
conjunction_ owned - Iterate parts in a conjunctive
Exprsuch asA AND B AND C=>[A, B, C] - merge_
grouping_ 🔒set - Merge two grouping_set
- merge_
schema - merge inputs schema into a single schema.
- only_
or_ err - Returns the first (and only) element in a slice, or an error
- powerset 🔒
- The power set (or powerset) of a set S is the set of all subsets of S,
including the empty set and S itself. - split_
binary - Splits an binary operator tree
Exprsuch asA <OP> B <OP> C=>[A, B, C] - split_
binary_ 🔒impl - split_
binary_ owned - Splits an owned binary operator tree
Exprsuch asA <OP> B <OP> C=>[A, B, C] - split_
binary_ 🔒owned_ impl - split_
conjunction - Splits a conjunctive
Exprsuch asA AND B AND C=>[A, B, C] - split_
conjunction_ 🔒impl - split_
conjunction_ owned - Splits an owned conjunctive
Exprsuch asA AND B AND C=>[A, B, C]
Type Aliases§
- Window
Sort 🔒Key - (expr, “is the SortExpr for window (either comes from PARTITION BY or ORDER BY columns)”)
If bool is true SortExpr comes from
PARTITION BYcolumn, if false comes fromORDER BYcolumn