public class RelOptRuleOperand extends Object
RelOptRule
can be applied to a particular expression.
For example, the rule to pull a filter up from the left side of a join
takes operands: Join(Filter, Any).
Note that children means different things if it is empty or
it is null: Join(Filter (), Any) means
that, to match the rule, Filter must have no operands.
| Modifier and Type | Field and Description |
|---|---|
RelOptRuleOperandChildPolicy |
childPolicy
Whether child operands can be matched in any order.
|
int |
ordinalInParent |
int |
ordinalInRule |
int[] |
solveOrder |
| Modifier | Constructor and Description |
|---|---|
protected |
RelOptRuleOperand(Class<R> clazz,
RelTrait trait,
com.google.common.base.Predicate<? super R> predicate,
RelOptRuleOperandChildren children)
Creates an operand.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
List<RelOptRuleOperand> |
getChildOperands()
Returns the child operands.
|
Class<? extends RelNode> |
getMatchedClass() |
RelOptRuleOperand |
getParent()
Returns the parent operand.
|
RelOptRule |
getRule()
Returns the rule this operand belongs to.
|
int |
hashCode() |
boolean |
matches(RelNode rel)
Returns whether a relational expression matches this operand.
|
void |
setParent(RelOptRuleOperand parent)
Sets the parent operand.
|
void |
setRule(RelOptRule rule)
Sets the rule this operand belongs to
|
public int[] solveOrder
public int ordinalInParent
public int ordinalInRule
public final RelOptRuleOperandChildPolicy childPolicy
protected RelOptRuleOperand(Class<R> clazz, RelTrait trait, com.google.common.base.Predicate<? super R> predicate, RelOptRuleOperandChildren children)
The childOperands argument is often populated by calling one
of the following methods:
RelOptRule.some(org.apache.calcite.plan.RelOptRuleOperand, org.apache.calcite.plan.RelOptRuleOperand...),
RelOptRule.none(),
RelOptRule.any(),
RelOptRule.unordered(org.apache.calcite.plan.RelOptRuleOperand, org.apache.calcite.plan.RelOptRuleOperand...),
See RelOptRuleOperandChildren for more
details.
clazz - Class of relational expression to match (must not be null)trait - Trait to match, or null to match any traitpredicate - Predicate to apply to relational expressionchildren - Child operandspublic RelOptRuleOperand getParent()
public void setParent(RelOptRuleOperand parent)
parent - Parent operandpublic RelOptRule getRule()
public void setRule(RelOptRule rule)
rule - containing rulepublic Class<? extends RelNode> getMatchedClass()
public List<RelOptRuleOperand> getChildOperands()
public boolean matches(RelNode rel)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.