Package org.apache.calcite.plan.volcano
Class VolcanoRuleCall
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRuleCall
-
- org.apache.calcite.plan.volcano.VolcanoRuleCall
-
- Direct Known Subclasses:
VolcanoPlanner.DeferringRuleCall
,VolcanoRuleMatch
public class VolcanoRuleCall extends RelOptRuleCall
VolcanoRuleCall
implements theRelOptRuleCall
interface for VolcanoPlanner.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<RelNode>
generatedRelList
List ofRelNode
generated by this call.protected VolcanoPlanner
volcanoPlanner
-
Fields inherited from class org.apache.calcite.plan.RelOptRuleCall
id, LOGGER, nodeInputs, operand0, rels, rule
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand)
Creates a rule call.protected
VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand, RelNode[] rels, java.util.Map<RelNode,java.util.List<RelNode>> nodeInputs)
Creates a rule call, internal, with array to hold bindings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
match(RelNode rel)
Applies this rule, with a given relational expression in the first slot.private void
matchRecurse(int solve)
Recursively matches operands above a given solve order.protected void
onMatch()
Called when all operands have matched.void
transformTo(RelNode rel, java.util.Map<RelNode,RelNode> equiv)
Registers that a rule has produced an equivalent relational expression.-
Methods inherited from class org.apache.calcite.plan.RelOptRuleCall
builder, getChildRels, getMetadataQuery, getOperand0, getParents, getPlanner, getRelList, getRels, getRule, rel, setChildRels, transformTo
-
-
-
-
Field Detail
-
volcanoPlanner
protected final VolcanoPlanner volcanoPlanner
-
-
Constructor Detail
-
VolcanoRuleCall
protected VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand, RelNode[] rels, java.util.Map<RelNode,java.util.List<RelNode>> nodeInputs)
Creates a rule call, internal, with array to hold bindings.- Parameters:
planner
- Planneroperand
- First operand of the rulerels
- Array which will hold the matched relational expressionsnodeInputs
- For each node which matched withmatchAnyChildren
= true, a list of the node's inputs
-
VolcanoRuleCall
VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand)
Creates a rule call.- Parameters:
planner
- Planneroperand
- First operand of the rule
-
-
Method Detail
-
transformTo
public void transformTo(RelNode rel, java.util.Map<RelNode,RelNode> equiv)
Description copied from class:RelOptRuleCall
Registers that a rule has produced an equivalent relational expression.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 byrel.getTraits()
will be copied fromthis.rels[0].getTraitSet()
.- Specified by:
transformTo
in classRelOptRuleCall
- Parameters:
rel
- Relational expression equivalent to the root relational expression of the rule call,call.rels(0)
equiv
- Map of other equivalences
-
onMatch
protected void onMatch()
Called when all operands have matched.
-
match
void match(RelNode rel)
Applies this rule, with a given relational expression in the first slot.
-
matchRecurse
private void matchRecurse(int solve)
Recursively matches operands above a given solve order.- Parameters:
solve
- Solve order of operand (> 0 and ≤ the operand count)
-
-