@Value.Enclosing public abstract class ConverterRule extends RelRule<ConverterRule.Config>
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConverterRule.Config
Rule configuration.
|
RelRule.Done, RelRule.MatchHandler<R extends RelOptRule>, RelRule.OperandBuilder, RelRule.OperandDetailBuilder<R extends RelNode>, RelRule.OperandTransformRelOptRule.ConverterRelOptRuleOperand| Modifier and Type | Field and Description |
|---|---|
protected Convention |
out |
description, operands, relBuilderFactory| Modifier | Constructor and Description |
|---|---|
protected |
ConverterRule(Class<? extends RelNode> clazz,
RelTrait in,
RelTrait out,
String descriptionPrefix)
Deprecated.
|
protected |
ConverterRule(Class<R> clazz,
Predicate<? super R> predicate,
RelTrait in,
RelTrait out,
RelBuilderFactory relBuilderFactory,
String descriptionPrefix)
Deprecated.
|
protected |
ConverterRule(Class<R> clazz,
com.google.common.base.Predicate<? super R> predicate,
RelTrait in,
RelTrait out,
RelBuilderFactory relBuilderFactory,
String description)
Deprecated.
|
protected |
ConverterRule(Class<R> clazz,
com.google.common.base.Predicate<? super R> predicate,
RelTrait in,
RelTrait out,
String descriptionPrefix)
Deprecated.
|
protected |
ConverterRule(ConverterRule.Config config)
Creates a
ConverterRule. |
| Modifier and Type | Method and Description |
|---|---|
abstract @Nullable 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, convertOperand, equals, equals, getOperand, getOperands, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unorderedprotected final Convention out
protected ConverterRule(ConverterRule.Config config)
ConverterRule.@Deprecated protected ConverterRule(Class<? extends RelNode> clazz, RelTrait in, RelTrait out, String descriptionPrefix)
ConverterRule(Config)ConverterRule.clazz - Type of relational expression to consider convertingin - Trait of relational expression to consider convertingout - Trait which is converted todescriptionPrefix - Description prefix of rule@Deprecated protected ConverterRule(Class<R> clazz, com.google.common.base.Predicate<? super R> predicate, RelTrait in, RelTrait out, String descriptionPrefix)
@Deprecated protected ConverterRule(Class<R> clazz, Predicate<? super R> predicate, RelTrait in, RelTrait out, RelBuilderFactory relBuilderFactory, String descriptionPrefix)
ConverterRule(Config)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 expressionsdescriptionPrefix - Description prefix of rule@Deprecated protected ConverterRule(Class<R> clazz, com.google.common.base.Predicate<? super R> predicate, RelTrait in, RelTrait out, RelBuilderFactory relBuilderFactory, String description)
public Convention getOutConvention()
RelOptRulegetOutConvention in class RelOptRulepublic RelTrait getOutTrait()
RelOptRulegetOutTrait in class RelOptRulepublic RelTrait getInTrait()
public RelTraitDef getTraitDef()
public abstract @Nullable 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>, 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.