Module canonicalize

Source
Expand description

Utility functions to transform parts of a single MirRelationExpr into canonical form.

Functions§

canonicalize_equivalence_classes
Canonicalize only the equivalence classes of a join.
canonicalize_equivalences
Canonicalize equivalence classes of a join and expressions contained in them.
canonicalize_predicates
Canonicalize predicates of a filter.
compare_predicates 🔒
Comparison method for sorting predicates by their complexity, measured by the total number of non-literal expression nodes within the expression.
flat_map_modify 🔒
Applies a flat_map on a Vec, and overwrites the vec with the result.
get_canonicalizer_map
For each equivalence class, it finds the simplest expression, which will be the canonical one. Returns a Map that maps from each expression in each equivalence class to the canonical expression in the same equivalence class.
is_not_null 🔒
Returns the inner operand if the given predicate is an IS NOT NULL expression.
is_null_rejecting_predicate 🔒
Whether the given predicate evaluates to NULL when the given operand expression is NULL.
propagates_null_from_subexpression 🔒
rank_complexity 🔒
Gives a relative complexity ranking for an expression. Higher numbers mean greater complexity.
replace_subexpr_and_reduce 🔒
Replace any matching subexpressions in predicate, and if predicate has changed, reduce it. Return whether predicate has changed.