Package org.apache.calcite.rel.rules
Class ReduceDecimalsRule.BinaryArithmeticExpander
- java.lang.Object
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.BinaryArithmeticExpander
-
- Enclosing class:
- ReduceDecimalsRule
private class ReduceDecimalsRule.BinaryArithmeticExpander extends ReduceDecimalsRule.RexExpander
Expands a decimal arithmetic expression
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
scaleA
(package private) int
scaleB
(package private) RelDataType
typeA
(package private) RelDataType
typeB
-
Fields inherited from class org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
builder, int8, real8
-
-
Constructor Summary
Constructors Modifier Constructor Description private
BinaryArithmeticExpander(RexBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
analyzeOperands(java.util.List<RexNode> operands)
Convenience method for reading characteristics of operands (such as scale, precision, whole digits) into an ArithmeticExpander.RexNode
expand(RexCall call)
Rewrites an expression containing decimals.private RexNode
expandComparison(RexCall call, java.util.List<RexNode> operands)
private RexNode
expandDivide(RexCall call, java.util.List<RexNode> operands)
private RexNode
expandMod(RexCall call, java.util.List<RexNode> operands)
private RexNode
expandPlusMinus(RexCall call, java.util.List<RexNode> operands)
private RexNode
expandTimes(RexCall call, java.util.List<RexNode> operands)
-
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
-
-
-
-
Field Detail
-
typeA
RelDataType typeA
-
typeB
RelDataType typeB
-
scaleA
int scaleA
-
scaleB
int scaleB
-
-
Constructor Detail
-
BinaryArithmeticExpander
private BinaryArithmeticExpander(RexBuilder builder)
-
-
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
-
analyzeOperands
private void analyzeOperands(java.util.List<RexNode> operands)
Convenience method for reading characteristics of operands (such as scale, precision, whole digits) into an ArithmeticExpander. The operands are restricted by the following contraints:- there are exactly two operands
- both are exact numeric types
-
-