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 |
@Nullable RelTrait |
trait |
| Modifier | Constructor and Description |
|---|---|
protected |
RelOptRuleOperand(Class<R> clazz,
RelTrait trait,
Predicate<? super R> predicate,
RelOptRuleOperandChildren children)
Deprecated.
Use
RelOptRule.operand(Class, RelOptRuleOperandChildren) or one of its
overloaded methods. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable Object obj) |
List<RelOptRuleOperand> |
getChildOperands()
Returns the child operands.
|
Class<? extends RelNode> |
getMatchedClass()
Returns relational expression class matched by this operand.
|
@Nullable 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(@Nullable RelOptRuleOperand parent)
Sets the parent operand.
|
void |
setRule(@UnknownInitialization RelOptRule rule)
Sets the rule this operand belongs to.
|
String |
toString()
FOR DEBUG ONLY.
|
public int[] solveOrder
public int ordinalInParent
public int ordinalInRule
public final @Nullable RelTrait trait
public final RelOptRuleOperandChildPolicy childPolicy
@Deprecated protected RelOptRuleOperand(Class<R> clazz, RelTrait trait, Predicate<? super R> predicate, RelOptRuleOperandChildren children)
RelOptRule.operand(Class, RelOptRuleOperandChildren) or one of its
overloaded methods.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 @Nullable RelOptRuleOperand getParent()
public void setParent(@Nullable RelOptRuleOperand parent)
parent - Parent operandpublic RelOptRule getRule()
public void setRule(@UnknownInitialization RelOptRule rule)
rule - containing rulepublic String toString()
To facilitate IDE shows the operand description in the debugger, returns the root operand description, but highlight current operand's matched class with '*' in the description.
e.g. The following are examples of rule operand description for
the operands that match with LogicalFilter.
toString in class ObjectdescribeIt(RelOptRuleOperand)public Class<? extends RelNode> getMatchedClass()
public List<RelOptRuleOperand> getChildOperands()
public boolean matches(RelNode rel)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.