Class FlinkHintStrategies

java.lang.Object
org.apache.flink.table.planner.hint.FlinkHintStrategies

public abstract class FlinkHintStrategies extends Object
A collection of Flink style HintStrategys.

Currently, Flink support table hints with table options and query hints including join hints and state ttl hints.

For handling query hints, the process is as follows:

  1. Resolve query hint propagation:
    1. The query hints are resolved using Calcite's functionality to propagate them from the sink to the source and within sub-queries
    2. Capitalize query hints: All query hints are capitalized to ensure consistency, as they are expected to be in uppercase.
    3. Clear incorrectly propagated query hints: Any query hints that have been mistakenly propagated into the query block are cleared.
    4. Clear query hints from unmatched nodes: Query hints attached to unmatched nodes, such as Project, are also cleared.
  2. Validate and modify query hints: The query hints are validated, and table names in the hints are replaced with LEFT or RIGHT to indicate the join input ordinal.
  3. Clear query block aliases: The query block aliases are cleared from the sink to the source.
  4. Consume query hints in applicable scenes. For example, the join hints are consumed in specific rules where they are relevant.
  • Constructor Details

    • FlinkHintStrategies

      public FlinkHintStrategies()
  • Method Details

    • createHintStrategyTable

      public static org.apache.calcite.rel.hint.HintStrategyTable createHintStrategyTable()
      Customize the HintStrategyTable which contains hint strategies supported by Flink.