public abstract class ConverterRule extends RelOptRule
| Modifier and Type | Field and Description |
|---|---|
private RelTrait |
inTrait |
private RelTrait |
outTrait |
description, operands, relBuilderFactory| 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,
RelBuilderFactory relBuilderFactory,
String description)
Creates a
ConverterRule with a predicate. |
ConverterRule(Class<R> clazz,
com.google.common.base.Predicate<? super R> predicate,
RelTrait in,
RelTrait out,
String description)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
abstract RelNode |
convert(RelNode rel)
Converts a relational expression to the target trait(s) of this rule.
|
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, convertOperand, 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 rule@Deprecated public ConverterRule(Class<R> clazz, com.google.common.base.Predicate<? super R> predicate, RelTrait in, RelTrait out, String description)
public ConverterRule(Class<R> clazz, com.google.common.base.Predicate<? super R> predicate, RelTrait in, RelTrait out, RelBuilderFactory relBuilderFactory, 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 torelBuilderFactory - Builder for relational expressionsdescription - Description of rulepublic Convention getOutConvention()
RelOptRulegetOutConvention in class RelOptRulepublic RelTrait getOutTrait()
RelOptRulegetOutTrait in class RelOptRulepublic RelTrait getInTrait()
public RelTraitDef getTraitDef()
public abstract RelNode convert(RelNode rel)
Returns null if conversion is not possible.
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–2018 The Apache Software Foundation. All rights reserved.