Class ReduceDecimalsRule.CaseExpander

  • Enclosing class:
    ReduceDecimalsRule

    private class ReduceDecimalsRule.CaseExpander
    extends ReduceDecimalsRule.RexExpander
    Expander that rewrites case expressions, in place. Starting from:
    (when $cond then $val)+ else $default

    this expander casts all values to the return type. If the target type is a decimal, then the values are then decoded. The result of expansion is that the case operator no longer deals with decimals args. (The return value is encoded if necessary.)

    Note: a decimal type is returned iff arguments have decimals.