public class ReduceDecimalsRule extends RelOptRule
The rule can be applied to a
LogicalCalc with a program for which
RexUtil.requiresDecimalExpansion(org.apache.calcite.rex.RexNode, boolean) returns true. The rule relies on a
RexShuttle to walk over relational expressions and replace them.
While decimals are generally not implemented by the Calcite runtime, the rule is optionally applied, in order to support the situation in which we would like to push down decimal operations to an external database.
| Modifier and Type | Class and Description |
|---|---|
class |
ReduceDecimalsRule.DecimalShuttle
A shuttle which converts decimal expressions to expressions based on
longs.
|
class |
ReduceDecimalsRule.RexExpander
Rewrites a decimal expression for a specific set of SqlOperator's.
|
| Modifier and Type | Field and Description |
|---|---|
static ReduceDecimalsRule |
INSTANCE |
description, operands| Modifier and Type | Method and Description |
|---|---|
Convention |
getOutConvention()
Returns the convention of the result of firing this rule, null if
not known.
|
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match.
|
any, convert, convert, convertList, equals, equals, getOperand, getOperands, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unorderedpublic static final ReduceDecimalsRule INSTANCE
public Convention getOutConvention()
RelOptRulegetOutConvention in class RelOptRulepublic void onMatch(RelOptRuleCall call)
RelOptRulecall.rels holds the set of relational
expressions which match the operands to the rule;
call.rels[0] is the root expression.
Typically a rule would check that the nodes are valid matches, creates
a new expression, then calls back RelOptRuleCall.transformTo(org.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>) to
register the expression.
onMatch in class RelOptRulecall - Rule callRelOptRule.matches(RelOptRuleCall)Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.