Interface HintPredicate

All Known Implementing Classes:
CompositeHintPredicate, NodeTypeHintPredicate

public interface HintPredicate
A 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.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    apply(RelHint hint, RelNode rel)
    Decides if the given hint can be applied to the relational expression rel.
  • Method Details

    • apply

      boolean apply(RelHint hint, RelNode rel)
      Decides if the given hint can be applied to the relational expression rel.
      Parameters:
      hint - The hint
      rel - The relational expression
      Returns:
      True if the hint can be applied to the rel