public abstract class RelOptRuleCall extends Object
RelOptRuleCall is an invocation of a RelOptRule with a
set of relational expressions as arguments.| Modifier and Type | Field and Description |
|---|---|
int |
id |
protected static Logger |
LOGGER |
RelNode[] |
rels |
RelOptRule |
rule |
| Modifier | Constructor and Description |
|---|---|
protected |
RelOptRuleCall(RelOptPlanner planner,
RelOptRuleOperand operand,
RelNode[] rels,
Map<RelNode,List<RelNode>> nodeInputs) |
protected |
RelOptRuleCall(RelOptPlanner planner,
RelOptRuleOperand operand,
RelNode[] rels,
Map<RelNode,List<RelNode>> nodeInputs,
List<RelNode> parents)
Creates a RelOptRuleCall.
|
| Modifier and Type | Method and Description |
|---|---|
List<RelNode> |
getChildRels(RelNode rel)
Returns the children of a given relational expression node matched in a
rule.
|
RelOptRuleOperand |
getOperand0()
Returns the root operand matched by this rule.
|
List<RelNode> |
getParents() |
RelOptPlanner |
getPlanner()
Returns the planner.
|
List<RelNode> |
getRelList()
Returns a list of matched relational expressions.
|
RelNode[] |
getRels()
Deprecated.
Use
getRelList() or rel(int) |
RelOptRule |
getRule()
Returns the invoked planner rule.
|
<T extends RelNode> |
rel(int ordinal)
Retrieves the
ordinalth matched relational expression. |
void |
transformTo(RelNode rel)
Registers that a rule has produced an equivalent relational expression,
but no other equivalences.
|
abstract void |
transformTo(RelNode rel,
Map<RelNode,RelNode> equiv)
Registers that a rule has produced an equivalent relational expression.
|
protected static final Logger LOGGER
public final int id
public final RelOptRule rule
public final RelNode[] rels
protected RelOptRuleCall(RelOptPlanner planner, RelOptRuleOperand operand, RelNode[] rels, Map<RelNode,List<RelNode>> nodeInputs, List<RelNode> parents)
planner - Planneroperand - Root operandrels - Array of relational expressions which matched each
operandnodeInputs - For each node which matched with
matchAnyChildren=true, a list of the node's
inputsparents - list of parent RelNodes corresponding to the first
relational expression in the array argument, if known;
otherwise, nullprotected RelOptRuleCall(RelOptPlanner planner, RelOptRuleOperand operand, RelNode[] rels, Map<RelNode,List<RelNode>> nodeInputs)
public RelOptRuleOperand getOperand0()
public RelOptRule getRule()
public RelNode[] getRels()
public List<RelNode> getRelList()
rel(int)public <T extends RelNode> T rel(int ordinal)
ordinalth matched relational expression. This
corresponds to the ordinalth operand of the rule.T - Typeordinal - Ordinalpublic List<RelNode> getChildRels(RelNode rel)
If the policy of the operand which caused the match is not
RelOptRuleOperandChildPolicy.ANY,
the children will have their
own operands and therefore be easily available in the array returned by
the getRels() method, so this method returns null.
This method is for
RelOptRuleOperandChildPolicy.ANY,
which is generally used when a node can have a variable number of
children, and hence where the matched children are not retrievable by any
other means.
rel - Relational expressionpublic RelOptPlanner getPlanner()
public List<RelNode> getParents()
public abstract void transformTo(RelNode rel, Map<RelNode,RelNode> equiv)
Called by the rule whenever it finds a match. The implementation of
this method guarantees that the original relational expression (that is,
this.rels[0]) has its traits propagated to the new
relational expression (rel) and its unregistered children.
Any trait not specifically set in the RelTraitSet returned by
rel.getTraits() will be copied from
this.rels[0].getTraitSet().
rel - Relational expression equivalent to the root relational
expression of the rule call, call.rels(0)equiv - Map of other equivalencespublic final void transformTo(RelNode rel)
rel - Relational expression equivalent to the root relational
expression of the rule call, call.rels(0)Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.