public class RelationalExpressionDepthProperty extends Object implements PlannerProperty<Integer>
Modifier and Type | Field and Description |
---|---|
static RelationalExpressionDepthProperty |
DISTINCT_FILTER_DEPTH |
static RelationalExpressionDepthProperty |
TYPE_FILTER_DEPTH |
Constructor and Description |
---|
RelationalExpressionDepthProperty(Set<Class<? extends RelationalPlannerExpression>> types) |
Modifier and Type | Method and Description |
---|---|
int |
evaluate(PlannerExpression expression) |
Integer |
evaluateAtExpression(PlannerExpression expression,
List<Integer> childResults)
Evaluate the property at the given expression, using the results of evaluating the property at its children.
|
Integer |
evaluateAtRef(ExpressionRef<? extends PlannerExpression> ref,
List<Integer> memberResults)
Evaluate the property at the given reference, using the results of evaluating the property at its members.
|
boolean |
shouldVisit(ExpressionRef<? extends PlannerExpression> ref)
Return whether the property should visit the subtree rooted at the given expression.
|
boolean |
shouldVisit(PlannerExpression expression)
Return whether the property should visit the subtree rooted at the given expression.
|
public static final RelationalExpressionDepthProperty TYPE_FILTER_DEPTH
public static final RelationalExpressionDepthProperty DISTINCT_FILTER_DEPTH
public RelationalExpressionDepthProperty(@Nonnull Set<Class<? extends RelationalPlannerExpression>> types)
public boolean shouldVisit(@Nonnull PlannerExpression expression)
PlannerProperty
shouldVisit()
is called on that node.
If shouldVisit()
returns false
, then PlannerProperty.evaluateAtExpression(PlannerExpression, List)
will
not be called on the given expression.shouldVisit
in interface PlannerProperty<Integer>
expression
- the planner expression to visittrue
if the children of expression
should be visited and false
if they should not be visitedpublic boolean shouldVisit(@Nonnull ExpressionRef<? extends PlannerExpression> ref)
PlannerProperty
shouldVisit()
is called on that node.
If shouldVisit()
returns false
, then PlannerProperty.evaluateAtRef(ExpressionRef, List)
will
not be called on the given expression.shouldVisit
in interface PlannerProperty<Integer>
ref
- the expression reference to visittrue
if the members of ref
should be visited and false
if they should not be visited@Nonnull public Integer evaluateAtExpression(@Nonnull PlannerExpression expression, @Nonnull List<Integer> childResults)
PlannerProperty
evaluateAtExpression()
is called on that node.evaluateAtExpression
in interface PlannerProperty<Integer>
expression
- the cursor to visitchildResults
- the results of the property evaluated at the children of expression
@Nonnull public Integer evaluateAtRef(@Nonnull ExpressionRef<? extends PlannerExpression> ref, @Nonnull List<Integer> memberResults)
PlannerProperty
evaluateAtRef()
is called on that node.evaluateAtRef
in interface PlannerProperty<Integer>
ref
- the expression reference to visitmemberResults
- the results of the property evaluated at the members of ref
public int evaluate(@Nonnull PlannerExpression expression)