Package org.apache.calcite.rel.rules
Class ReduceDecimalsRule.PassThroughExpander
- java.lang.Object
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
-
- org.apache.calcite.rel.rules.ReduceDecimalsRule.PassThroughExpander
-
- Enclosing class:
- ReduceDecimalsRule
private class ReduceDecimalsRule.PassThroughExpander extends ReduceDecimalsRule.RexExpander
An expander that substitutes decimals with their integer representations. If the output is decimal, the output is reinterpreted from the integer representation into a decimal.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
builder, int8, real8
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PassThroughExpander(RexBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExpand(RexCall call)
This defaults to the utility method,RexUtil.requiresDecimalExpansion(RexNode, boolean)
which checks general guidelines on whether a rewrite should be considered at all.RexNode
expand(RexCall call)
Rewrites an expression containing decimals.-
Methods inherited from class org.apache.calcite.rel.rules.ReduceDecimalsRule.RexExpander
accessValue, 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
-
PassThroughExpander
private PassThroughExpander(RexBuilder builder)
-
-
Method Detail
-
canExpand
public boolean canExpand(RexCall call)
Description copied from class:ReduceDecimalsRule.RexExpander
This defaults to the utility method,RexUtil.requiresDecimalExpansion(RexNode, boolean)
which checks general guidelines on whether a rewrite should be considered at all. In general, it is helpful to update the utility method since that method is often used to filter the somewhat expensive rewrite process.However, this method provides another place for implementations of RexExpander to make a more detailed analysis before deciding on whether to perform a rewrite.
- Overrides:
canExpand
in classReduceDecimalsRule.RexExpander
-
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
-
-