Class FlinkHints

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

public abstract class FlinkHints extends Object
Utility class for Flink hints.
  • Field Details

  • Constructor Details

    • FlinkHints

      public FlinkHints()
  • Method Details

    • getHintedOptions

      public static Map<String,String> getHintedOptions(List<org.apache.calcite.rel.hint.RelHint> tableHints)
      Returns the OPTIONS hint options from the given list of table hints tableHints, never null.
    • mergeTableOptions

      public static Map<String,String> mergeTableOptions(Map<String,String> hints, Map<String,String> props)
      Merges the dynamic table options from hints and static table options from table definition props.

      The options in hints would override the ones in props if they have the same option key.

      Parameters:
      hints - Dynamic table options, usually from the OPTIONS hint
      props - Static table options defined in DDL or connect API
      Returns:
      New options with merged dynamic table options, or the old props if there is no dynamic table options
    • getTableAlias

      public static Optional<String> getTableAlias(org.apache.calcite.rel.RelNode node)
    • canTransposeToTableScan

      public static boolean canTransposeToTableScan(org.apache.calcite.rel.RelNode node)
    • getTableName

      public static Optional<String> getTableName(org.apache.calcite.plan.RelOptTable table)
      Returns the qualified name of a table scan, otherwise returns empty.
    • stringifyHints

      public static String stringifyHints(List<org.apache.calcite.rel.hint.RelHint> hints)
    • getAllQueryHints

      public static List<org.apache.calcite.rel.hint.RelHint> getAllQueryHints(List<org.apache.calcite.rel.hint.RelHint> allHints)
      Get all query hints.
    • getAllJoinHints

      public static List<org.apache.calcite.rel.hint.RelHint> getAllJoinHints(List<org.apache.calcite.rel.hint.RelHint> allHints)
      Get all join hints.
    • getAllStateTtlHints

      public static List<org.apache.calcite.rel.hint.RelHint> getAllStateTtlHints(List<org.apache.calcite.rel.hint.RelHint> allHints)
      Get all state ttl hints.
    • getQueryBlockAliasHints

      public static List<org.apache.calcite.rel.hint.RelHint> getQueryBlockAliasHints(List<org.apache.calcite.rel.hint.RelHint> allHints)
      Get all query block alias hints.

      Because query block alias hints will be propagated from root to leaves, so maybe one node will contain multi alias hints. But only the first one is the real query block name where this node is.

    • capitalizeQueryHints

      public static org.apache.calcite.rel.RelNode capitalizeQueryHints(org.apache.calcite.rel.RelNode root)
    • resolveSubQuery

      public static org.apache.calcite.rel.RelNode resolveSubQuery(org.apache.calcite.rel.RelNode node, Function<org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode> resolver)
      Resolve the RelNode of the sub query in the node and return a new node.
    • clearQueryHintsOnUnmatchedNodes

      public static org.apache.calcite.rel.RelNode clearQueryHintsOnUnmatchedNodes(org.apache.calcite.rel.RelNode root)
      Clear the query hints on some nodes where these hints should not be attached.
    • isQueryHint

      public static boolean isQueryHint(String hintName)
      Check if the hint is a query hint.
    • isAliasHint

      public static boolean isAliasHint(String hintName)
      Check if the hint is a alias hint.