Interface HintPredicate
- All Known Implementing Classes:
CompositeHintPredicate
,NodeTypeHintPredicate
HintPredicate
indicates whether a RelNode
can apply the specified hint.
Every supported hint should register a HintPredicate
into the HintStrategyTable
. For example, HintPredicates.JOIN
implies
that this hint would be propagated and applied to the Join
relational expressions.
Usually use NodeTypeHintPredicate
is enough for most of the RelHint
s.
Some of the hints can only be matched to the relational expression with special
match conditions(not only the relational expression type).
i.e. "hash_join(r, st)", this hint can only be applied to JOIN expression that
has "r" and "st" as the input table names. To implement this, you can make a custom
HintPredicate
instance.
A HintPredicate
can be used independently or cascaded with other strategies
with method HintPredicates.and(org.apache.calcite.rel.hint.HintPredicate...)
.
In HintStrategyTable
the predicate is used for
hints registration.
- See Also:
-
Method Summary
-
Method Details
-
apply
Decides if the givenhint
can be applied to the relational expressionrel
.- Parameters:
hint
- The hintrel
- The relational expression- Returns:
- True if the
hint
can be applied to therel
-