org.eigenbase.rel.rules
Class ReduceDecimalsRule.BinaryArithmeticExpander

java.lang.Object
  extended by org.eigenbase.rel.rules.ReduceDecimalsRule.RexExpander
      extended by org.eigenbase.rel.rules.ReduceDecimalsRule.BinaryArithmeticExpander
Enclosing class:
ReduceDecimalsRule

private class ReduceDecimalsRule.BinaryArithmeticExpander
extends ReduceDecimalsRule.RexExpander

Expands a decimal arithmetic expression


Field Summary
(package private)  int scaleA
           
(package private)  int scaleB
           
(package private)  RelDataType typeA
           
(package private)  RelDataType typeB
           
 
Fields inherited from class org.eigenbase.rel.rules.ReduceDecimalsRule.RexExpander
builder, int8, real8
 
Constructor Summary
private ReduceDecimalsRule.BinaryArithmeticExpander(RexBuilder builder)
           
 
Method Summary
private  void analyzeOperands(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, RexNode[] operands)
           
private  RexNode expandDivide(RexCall call, RexNode[] operands)
           
private  RexNode expandMod(RexCall call, RexNode[] operands)
           
private  RexNode expandPlusMinus(RexCall call, RexNode[] operands)
           
private  RexNode expandTimes(RexCall call, RexNode[] operands)
           
 
Methods inherited from class org.eigenbase.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, matchNullability, powerOfTen, scaleDown, scaleDownDouble, scaleUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeA

RelDataType typeA

typeB

RelDataType typeB

scaleA

int scaleA

scaleB

int scaleB
Constructor Detail

ReduceDecimalsRule.BinaryArithmeticExpander

private ReduceDecimalsRule.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 class ReduceDecimalsRule.RexExpander

analyzeOperands

private void analyzeOperands(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:


expandPlusMinus

private RexNode expandPlusMinus(RexCall call,
                                RexNode[] operands)

expandDivide

private RexNode expandDivide(RexCall call,
                             RexNode[] operands)

expandTimes

private RexNode expandTimes(RexCall call,
                            RexNode[] operands)

expandComparison

private RexNode expandComparison(RexCall call,
                                 RexNode[] operands)

expandMod

private RexNode expandMod(RexCall call,
                          RexNode[] operands)