Class RelOptRuleOperand
- Direct Known Subclasses:
RelOptRule.ConverterRelOptRuleOperand
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.
-
Field Summary
Modifier and TypeFieldDescriptionWhether child operands can be matched in any order.int
int
int @MonotonicNonNull []
final @Nullable RelTrait
-
Constructor Summary
ModifierConstructorDescriptionprotected
RelOptRuleOperand
(Class<R> clazz, RelTrait trait, Predicate<? super R> predicate, RelOptRuleOperandChildren children) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the child operands.Returns relational expression class matched by this operand.@Nullable RelOptRuleOperand
Returns the parent operand.getRule()
Returns the rule this operand belongs to.int
hashCode()
boolean
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.toString()
FOR DEBUG ONLY.
-
Field Details
-
solveOrder
public int @MonotonicNonNull [] solveOrder -
ordinalInParent
public int ordinalInParent -
ordinalInRule
public int ordinalInRule -
trait
-
childPolicy
Whether child operands can be matched in any order.
-
-
Constructor Details
-
RelOptRuleOperand
@Deprecated protected RelOptRuleOperand(Class<R> clazz, RelTrait trait, Predicate<? super R> predicate, RelOptRuleOperandChildren children) Deprecated.UseRelOptRule.operand(Class, RelOptRuleOperandChildren)
or one of its overloaded methods.Creates an operand.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...)
, SeeRelOptRuleOperandChildren
for more details.- Parameters:
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 operands
-
-
Method Details
-
getParent
Returns the parent operand.- Returns:
- parent operand
-
setParent
Sets the parent operand.- Parameters:
parent
- Parent operand
-
getRule
Returns the rule this operand belongs to.- Returns:
- containing rule
-
setRule
Sets the rule this operand belongs to.- Parameters:
rule
- containing rule
-
hashCode
public int hashCode() -
equals
-
toString
FOR DEBUG ONLY.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
.- SemiJoinRule:project: Project(Join(*RelNode*, Aggregate))
- ProjectFilterTransposeRule: LogicalProject(*LogicalFilter*)
- FilterProjectTransposeRule: *Filter*(Project)
- ReduceExpressionsRule(Filter): *LogicalFilter*
- PruneEmptyJoin(right): Join(*RelNode*, Values)
-
getMatchedClass
Returns relational expression class matched by this operand. -
getChildOperands
Returns the child operands.- Returns:
- child operands
-
matches
Returns whether a relational expression matches this operand. It must be of the right class and trait.
-
RelOptRule.operand(Class, RelOptRuleOperandChildren)
or one of its overloaded methods.