Module utils

Module utils 

Source
Expand description

SQL Utility Functions

StructsΒ§

RecursiveUnnestRewriter πŸ”’

EnumsΒ§

CheckColumnsMustReferenceAggregatePurpose πŸ”’
CheckColumnsSatisfyExprsPurpose πŸ”’

ConstantsΒ§

UNNEST_PLACEHOLDER

FunctionsΒ§

check_column_satisfies_expr πŸ”’
check_columns_satisfy_exprs πŸ”’
Determines if the set of Expr’s are a valid projection on the input Expr::Column’s.
extract_aliases πŸ”’
Returns mapping of each alias (String) to the expression (Expr) it is aliasing.
make_decimal_type πŸ”’
Returns a validated DataType for the specified precision and scale
normalize_ident πŸ”’
Normalize an owned identifier to a lowercase string, unless the identifier is quoted.
push_projection_dedupl πŸ”’
rebase_expr πŸ”’
Rebuilds an Expr as a projection on top of a collection of Expr’s.
resolve_aliases_to_exprs πŸ”’
Rebuilds an Expr with columns that refer to aliases replaced by the alias’ underlying Expr.
resolve_columns πŸ”’
Make a best-effort attempt at resolving all columns in the expression tree
resolve_positions_to_exprs πŸ”’
Given an expression that’s literal int encoding position, lookup the corresponding expression in the select_exprs list, if the index is within the bounds and it is indeed a position literal, otherwise, returns planning error. If input expression is not an int literal, returns expression as-is.
rewrite_recursive_unnest_bottom_up πŸ”’
The context is we want to rewrite unnest() into InnerProjection->Unnest->OuterProjection Given an expression which contains unnest expr as one of its children, Try transform depends on unnest type
rewrite_recursive_unnests_bottom_up πŸ”’
value_to_string πŸ”’
window_expr_common_partition_keys
Given a slice of window expressions sharing the same sort key, find their common partition keys.