Function expr::relation::canonicalize::canonicalize_equivalences[][src]

pub fn canonicalize_equivalences(
    equivalences: &mut Vec<Vec<MirScalarExpr>>,
    input_types: &[RelationType]
)
Expand description

Canonicalize equivalence classes of a join and expressions contained in them.

input_types can be the RelationType of the join or the RelationType of the individual inputs of the join in order.

This function:

  • simplifies expressions to involve the least number of non-literal nodes. This ensures that we only replace expressions by “even simpler” expressions and that repeated substitutions reduce the complexity of expressions and a fixed point is certain to be reached. Without this rule, we might repeatedly replace a simple expression with an equivalent complex expression containing that (or another replaceable) simple expression, and repeat indefinitely.
  • reduces all expressions contained in equivalences.
  • Does everything that canonicalize_equivalence_classes does.