public interface HintPredicate
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 RelHints.
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.
HintStrategyTable| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(RelHint hint,
RelNode rel)
Decides if the given
hint can be applied to
the relational expression rel. |
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.