|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.RelOptRuleOperand
public class RelOptRuleOperand
A RelOptRuleOperand
determines whether a 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.
Nested Class Summary | |
---|---|
static class |
RelOptRuleOperand.Dummy
Dummy type, containing a single value, for parameters to overloaded forms of the RelOptRuleOperand constructor
signifying operands that will be matched by relational expressions with
any number of children. |
Field Summary | |
---|---|
private RelOptRuleOperand[] |
children
|
private Class<? extends RelNode> |
clazz
|
boolean |
matchAnyChildren
|
int |
ordinalInParent
|
int |
ordinalInRule
|
private RelOptRuleOperand |
parent
|
private RelOptRule |
rule
|
int[] |
solveOrder
|
private RelTrait |
trait
|
Constructor Summary | |
---|---|
RelOptRuleOperand(Class<? extends RelNode> clazz,
RelOptRuleOperand... children)
Creates an operand that matches child operands in the order they appear. |
|
RelOptRuleOperand(Class<? extends RelNode> clazz,
RelOptRuleOperand.Dummy dummy)
Creates an operand that matches any number of children. |
|
RelOptRuleOperand(Class<? extends RelNode> clazz,
RelTrait trait,
boolean matchAnyChild,
RelOptRuleOperand... children)
Creates an operand. |
|
RelOptRuleOperand(Class<? extends RelNode> clazz,
RelTrait trait,
RelOptRuleOperand... children)
Creates an operand which matches a given trait and matches child operands in the order they appear. |
|
RelOptRuleOperand(Class<? extends RelNode> clazz,
RelTrait trait,
RelOptRuleOperand.Dummy dummy)
Creates an operand that matches a given trait and any number of children. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private RelOptRuleOperand parent
private RelOptRule rule
public int[] solveOrder
public int ordinalInParent
public int ordinalInRule
private final RelTrait trait
private final Class<? extends RelNode> clazz
private final RelOptRuleOperand[] children
public final boolean matchAnyChildren
Constructor Detail |
---|
public RelOptRuleOperand(Class<? extends RelNode> clazz, RelTrait trait, boolean matchAnyChild, RelOptRuleOperand... children)
If children
is null, the rule matches regardless of the
number of children.
If matchAnyChild
is true, child operands can be matched
in any order. This is useful when matching a relational expression which
can have a variable number of children. For example, the rule to
eliminate empty children of a Union would have operands
Operand(UnionRel, true, Operand(EmptyRel))and given the relational expressions
UnionRel(FilterRel, EmptyRel, ProjectRel)would fire the rule with arguments
{Union, Empty}It is up to the rule to deduce the other children, or indeed the position of the matched child.
clazz
- Class of relational expression to match (must not be null)trait
- Trait to match, or null to match any traitmatchAnyChild
- Whether child operands can be matched in any orderchildren
- Child operands; or null, meaning match any number of
childrenpublic RelOptRuleOperand(Class<? extends RelNode> clazz, RelTrait trait, RelOptRuleOperand... children)
clazz
- Class of relational expression to match (must not be null)trait
- Trait to match, or null to match any traitchildren
- Child operands; must not be nullpublic RelOptRuleOperand(Class<? extends RelNode> clazz, RelTrait trait, RelOptRuleOperand.Dummy dummy)
clazz
- Class of relational expression to match (must not be null)trait
- Trait to match, or null to match any traitdummy
- Dummy argument to distinguish this constructor from other
overloaded formspublic RelOptRuleOperand(Class<? extends RelNode> clazz, RelOptRuleOperand... children)
If children
is null, the rule matches regardless of the
number of children.
clazz
- Class of relational expression to match (must not be null)children
- Child operands; must not be nullpublic RelOptRuleOperand(Class<? extends RelNode> clazz, RelOptRuleOperand.Dummy dummy)
clazz
- Class of relational expression to match (must not be null)dummy
- Dummy argument to distinguish this constructor from other
overloaded formsMethod Detail |
---|
public RelOptRuleOperand getParent()
public void setParent(RelOptRuleOperand parent)
parent
- Parent operandpublic RelOptRule getRule()
public void setRule(RelOptRule rule)
rule
- containing rulepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public Class<? extends RelNode> getMatchedClass()
public RelOptRuleOperand[] getChildOperands()
public boolean matches(RelNode rel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |