@Value.Enclosing public class ReduceDecimalsRule extends RelRule<ReduceDecimalsRule.Config> implements TransformationRule
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.
CoreRules.CALC_REDUCE_DECIMALS| Modifier and Type | Class and Description |
|---|---|
static interface |
ReduceDecimalsRule.Config
Rule configuration.
|
static class |
ReduceDecimalsRule.DecimalShuttle
A shuttle which converts decimal expressions to expressions based on
longs.
|
static class |
ReduceDecimalsRule.RexExpander
Rewrites a decimal expression for a specific set of SqlOperator's.
|
RelRule.Done, RelRule.MatchHandler<R extends RelOptRule>, RelRule.OperandBuilder, RelRule.OperandDetailBuilder<R extends RelNode>, RelRule.OperandTransformRelOptRule.ConverterRelOptRuleOperanddescription, operands, relBuilderFactory| Modifier | Constructor and Description |
|---|---|
protected |
ReduceDecimalsRule(ReduceDecimalsRule.Config config)
Creates a ReduceDecimalsRule.
|
|
ReduceDecimalsRule(RelBuilderFactory relBuilderFactory)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
@Nullable 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, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unorderedprotected ReduceDecimalsRule(ReduceDecimalsRule.Config config)
@Deprecated public ReduceDecimalsRule(RelBuilderFactory relBuilderFactory)
public @Nullable 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>, org.apache.calcite.plan.RelHintsPropagator) to
register the expression.
onMatch in class RelOptRulecall - Rule callRelOptRule.matches(RelOptRuleCall)Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.