Package org.apache.calcite.rel.rules
Class ReduceDecimalsRule.DecimalShuttle
- java.lang.Object
-
- org.apache.calcite.rex.RexShuttle
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.DecimalShuttle
-
- All Implemented Interfaces:
RexVisitor<RexNode>
- Enclosing class:
- ReduceDecimalsRule
public class ReduceDecimalsRule.DecimalShuttle extends RexShuttle
A shuttle which converts decimal expressions to expressions based on longs.
-
-
Field Summary
Fields Modifier and Type Field Description private ReduceDecimalsRule.ExpanderMap
expanderMap
private java.util.Map<Pair<RexNode,java.lang.String>,RexNode>
irreducible
private java.util.Map<Pair<RexNode,java.lang.String>,RexNode>
results
-
Constructor Summary
Constructors Constructor Description DecimalShuttle(RexBuilder rexBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ReduceDecimalsRule.RexExpander
getExpander(RexCall call)
Returns aReduceDecimalsRule.RexExpander
for a callprivate RexNode
lookup(RexNode node)
Lookup registered nodeprivate void
register(RexNode node, RexNode reducedNode)
Registers node so it will not be computed againprivate RexNode
rewriteCall(RexCall call)
Rewrites a call, if required, or returns the original callRexNode
visitCall(RexCall call)
Rewrites a call in place, from bottom up, as follows: visit operands visit call node rewrite call visit the rewritten call-
Methods inherited from class org.apache.calcite.rex.RexShuttle
apply, apply, apply, mutate, visitArray, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitFieldCollations, visitInputRef, visitList, visitList, visitLiteral, visitLocalRef, visitOver, visitPatternFieldRef, visitRangeRef, visitSubQuery, visitTableInputRef, visitWindow
-
-
-
-
Constructor Detail
-
DecimalShuttle
public DecimalShuttle(RexBuilder rexBuilder)
-
-
Method Detail
-
visitCall
public RexNode visitCall(RexCall call)
Rewrites a call in place, from bottom up, as follows:- visit operands
- visit call node
- rewrite call
- visit the rewritten call
- Specified by:
visitCall
in interfaceRexVisitor<RexNode>
- Overrides:
visitCall
in classRexShuttle
-
register
private void register(RexNode node, RexNode reducedNode)
Registers node so it will not be computed again
-
rewriteCall
private RexNode rewriteCall(RexCall call)
Rewrites a call, if required, or returns the original call
-
getExpander
private ReduceDecimalsRule.RexExpander getExpander(RexCall call)
Returns aReduceDecimalsRule.RexExpander
for a call
-
-