Package org.apache.calcite.rel.rules
Class ReduceDecimalsRule.CaseExpander
- java.lang.Object
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
-
- org.apache.calcite.rel.rules.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.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
builder, int8, real8
-
-
Constructor Summary
Constructors Modifier Constructor Description private
CaseExpander(RexBuilder rexBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RexNode
expand(RexCall call)
Rewrites an expression containing decimals.-
Methods inherited from class org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
accessValue, canExpand, decodeValue, encodeValue, encodeValue, ensureScale, ensureType, ensureType, makeApproxLiteral, makeApproxScaleFactor, makeCase, makeCase, makeDivide, makeExactLiteral, makeIsNegative, makeIsPositive, makeMinus, makeMultiply, makePlus, makeRoundFactor, makeScaleFactor, powerOfTen, scaleDown, scaleDownDouble, scaleUp
-
-
-
-
Constructor Detail
-
CaseExpander
private CaseExpander(RexBuilder rexBuilder)
-
-
Method Detail
-
expand
public RexNode expand(RexCall call)
Description copied from class:ReduceDecimalsRule.RexExpander
Rewrites an expression containing decimals. Normally, this method always performs a rewrite, but implementations may choose to return the original expression if no change was required.- Specified by:
expand
in classReduceDecimalsRule.RexExpander
-
-