Skip to main content

Module transform_hir

Module transform_hir 

Source
Expand description

Transformations of SQL IR, before decorrelation.

StaticsΒ§

NO_PARAMS πŸ”’
An empty parameter type map.

FunctionsΒ§

column_type πŸ”’
from_less_existence_predicate πŸ”’
If sub is a FROM-less subquery (see simplify_from_less_existence_subqueries) whose existence check is correlated on the outer row, returns the predicate p1 AND p2 AND ... expressed in the outer row’s frame. Returns None otherwise.
fuse_window_functions
Aims and scope
resolve_local_columns πŸ”’
Returns expr with every reference to the current scope (a ColumnRef with level == 0) replaced by its value from env. Returns None if expr cannot be soundly lifted into the outer scope, or references a column absent from env.
simplify_from_less_existence_subqueries
Collapses EXISTS over a FROM-less subquery into an equivalent scalar predicate on the outer row, so that decorrelation produces a plain Filter rather than a semijoin (for EXISTS) or an antijoin (for NOT EXISTS).
split_subquery_predicates
Rewrites predicates that contain subqueries so that the subqueries appear in their own later predicate when possible.
try_simplify_quantified_comparisons
Rewrites quantified comparisons into simpler EXISTS operators.