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
plan
with a LogicalPlan::Filter with allpredicates
ANDed. - 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.
- collect_
subquery_ cols - Determine the set of
Column
s 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.
- 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::GroupingSet
or only has one expression,
no conversion will be performed. - expand_
qualified_ wildcard - Resolves an
Expr::Wildcard
to a collection of qualifiedExpr::Column
’s. - expand_
wildcard - Resolves an
Expr::Wildcard
to a collection ofExpr::Column
’s. - expr_
as_ column_ expr - Convert any
Expr
to anExpr::Column
. - expr_
to_ columns - Recursively walk an expression tree, collecting the unique set of columns referenced in the expression
- exprlist_
len - Count the number of real fields. We should expand the wildcard expression to get the actual number.
- exprlist_
to_ columns Deprecated - Recursively walk a list of expression trees, collecting the unique set of columns referenced in the expression
- exprlist_
to_ fields - Create field meta-data from an expression, for use in a result set schema
- find_
aggregate_ exprs - Collect all deeply nested
Expr::AggregateFunction
. They are returned in order of occurrence (depth first), with duplicates omitted. - find_
base_ plan - Find the suitable base plan to expand the wildcard expression recursively. When planning LogicalPlan::Window and LogicalPlan::Aggregate, we will generate an intermediate plan based on the relation plan (e.g. LogicalPlan::TableScan, LogicalPlan::Subquery, …). If we expand a wildcard expression basing the intermediate plan, we could get some duplicate fields.
- find_
column_ exprs - Collect all deeply nested
Expr::Column
’s. They are returned in order of appearance (depth first), and may contain duplicates. - 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
- 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
GroupingSet
expression 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
GroupingSet
expression then it must be the only expr. - inspect_
expr_ pre - Recursively inspect an
Expr
and all its children. - iter_
conjunction - Iterate parts in a conjunctive
Expr
such asA AND B AND C
=>[A, B, C]
- iter_
conjunction_ owned - Iterate parts in a conjunctive
Expr
such asA AND B AND C
=>[A, B, C]
- merge_
schema - merge inputs schema into a single schema.
- only_
or_ err - Returns the first (and only) element in a slice, or an error
- split_
binary - Splits an binary operator tree
Expr
such asA <OP> B <OP> C
=>[A, B, C]
- split_
binary_ owned - Splits an owned binary operator tree
Expr
such asA <OP> B <OP> C
=>[A, B, C]
- split_
conjunction - Splits a conjunctive
Expr
such asA AND B AND C
=>[A, B, C]
- split_
conjunction_ owned - Splits an owned conjunctive
Expr
such asA AND B AND C
=>[A, B, C]