Class RexNormalize

java.lang.Object
org.apache.calcite.rex.RexNormalize

public class RexNormalize extends Object
Context required to normalize a row-expression.

Currently, only simple normalization is supported, such as:

  • $2 = $1 → $1 = $2
  • $2 > $1 → $1 < $2
  • 1.23 = $1 → $1 = 1.23
  • OR(OR(udf($1), $2), $3) → OR($3, OR($2, udf($1)))

In the future, this component may extend to support more normalization cases for general promotion. e.g. the strategy to decide which operand is more complex should be more smart.

There is no one normalization strategy that works for all cases, and no consensus about what the desired strategies should be. So by default, the normalization is disabled. We do force normalization when computing the digest of RexCalls during planner planning.