private class ReduceDecimalsRule.CaseExpander extends ReduceDecimalsRule.RexExpander
(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.
builder, int8, real8| Modifier | Constructor and Description |
|---|---|
private |
CaseExpander(RexBuilder rexBuilder) |
| Modifier and Type | Method and Description |
|---|---|
RexNode |
expand(RexCall call)
Rewrites an expression containing decimals.
|
accessValue, canExpand, decodeValue, encodeValue, encodeValue, ensureScale, ensureType, ensureType, makeApproxLiteral, makeApproxScaleFactor, makeCase, makeCase, makeDivide, makeExactLiteral, makeIsNegative, makeIsPositive, makeMinus, makeMultiply, makePlus, makeRoundFactor, makeScaleFactor, powerOfTen, scaleDown, scaleDownDouble, scaleUpprivate CaseExpander(RexBuilder rexBuilder)
public RexNode expand(RexCall call)
ReduceDecimalsRule.RexExpanderexpand in class ReduceDecimalsRule.RexExpanderCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.