Expand description
Shared expression utilities for optimizer passes.
Provides:
- SQL fragment parsing helpers (
parse_predicate,parse_expr) - Expression rendering (
render) - Conjunct splitting and joining (
split_conjuncts,join_conjuncts) - Equi-join key extraction (
equi_key) - Column-reference collection (
collect_colrefs) - Canonical structural hashing (
canonical_hash) - Common-subexpression detection (
find_common_subexprs)
Structs§
- ColRef
- A qualified column reference extracted from an expression.
Functions§
- canonical_
hash - Compute a canonical (order-normalised) structural hash of an
Expr. - collect_
colrefs - Collect all column references reachable from
e. - equi_
key - If
eis an equi-join predicatea.x = b.y(orx = y), return the twoColRefs. ReturnsNonefor any other expression shape. - find_
common_ subexprs - Find common (repeated) subexpressions in
eby canonical hash. - join_
conjuncts - Join a list of expressions with AND.
- parse_
expr - Parse a standalone SQL expression (not a WHERE predicate), returning
Noneon failure. - parse_
predicate - Parse a SQL predicate string into an
Expr, returningNoneon failure. - render
- Render an
Exprback to a SQL string via itsDisplayimplementation. - split_
conjuncts - Split a top-level AND expression into its conjuncts (leaves of the AND tree).