public abstract class ConverterRule extends RelOptRule
description, operands| Constructor and Description |
|---|
ConverterRule(Class<? extends RelNode> clazz,
RelTrait in,
RelTrait out,
String description)
Creates a
ConverterRule. |
ConverterRule(Class<R> clazz,
com.google.common.base.Predicate<? super R> predicate,
RelTrait in,
RelTrait out,
String description)
Creates a
ConverterRule with a predicate. |
| Modifier and Type | Method and Description |
|---|---|
abstract RelNode |
convert(RelNode rel) |
RelTrait |
getInTrait() |
Convention |
getOutConvention()
Returns the convention of the result of firing this rule, null if
not known.
|
RelTrait |
getOutTrait()
Returns the trait which will be modified as a result of firing this rule,
or null if the rule is not a converter rule.
|
RelTraitDef |
getTraitDef() |
boolean |
isGuaranteed()
Returns true if this rule can convert any relational expression
of the input convention.
|
void |
onMatch(RelOptRuleCall call)
Receives notification about a rule match.
|
any, convert, convert, convertList, equals, equals, getOperand, getOperands, hashCode, matches, none, operand, operand, operand, operand, operand, some, toString, unorderedpublic ConverterRule(Class<? extends RelNode> clazz, RelTrait in, RelTrait out, String description)
ConverterRule.clazz - Type of relational expression to consider convertingin - Trait of relational expression to consider convertingout - Trait which is converted todescription - Description of rulepublic ConverterRule(Class<R> clazz, com.google.common.base.Predicate<? super R> predicate, RelTrait in, RelTrait out, String description)
ConverterRule with a predicate.clazz - Type of relational expression to consider convertingpredicate - Predicate on the relational expressionin - Trait of relational expression to consider convertingout - Trait which is converted todescription - Description of rulepublic Convention getOutConvention()
RelOptRulegetOutConvention in class RelOptRulepublic RelTrait getOutTrait()
RelOptRulegetOutTrait in class RelOptRulepublic RelTrait getInTrait()
public RelTraitDef getTraitDef()
public boolean isGuaranteed()
The union-to-java converter, for example, is not guaranteed, because it only works on unions.
true if this rule can convert any relational
expressionpublic 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.