Class FlinkHints
java.lang.Object
org.apache.flink.table.planner.hint.FlinkHints
Utility class for Flink hints.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanTransposeToTableScan(org.apache.calcite.rel.RelNode node) static org.apache.calcite.rel.RelNodecapitalizeQueryHints(org.apache.calcite.rel.RelNode root) static org.apache.calcite.rel.RelNodeclearQueryHintsOnUnmatchedNodes(org.apache.calcite.rel.RelNode root) Clear the query hints on some nodes where these hints should not be attached.static List<org.apache.calcite.rel.hint.RelHint>getAllJoinHints(List<org.apache.calcite.rel.hint.RelHint> allHints) Get all join hints.static List<org.apache.calcite.rel.hint.RelHint>getAllQueryHints(List<org.apache.calcite.rel.hint.RelHint> allHints) Get all query hints.static List<org.apache.calcite.rel.hint.RelHint>getAllStateTtlHints(List<org.apache.calcite.rel.hint.RelHint> allHints) Get all state ttl hints.getHintedOptions(List<org.apache.calcite.rel.hint.RelHint> tableHints) Returns the OPTIONS hint options from the given list of table hintstableHints, never null.static List<org.apache.calcite.rel.hint.RelHint>getQueryBlockAliasHints(List<org.apache.calcite.rel.hint.RelHint> allHints) Get all query block alias hints.getTableAlias(org.apache.calcite.rel.RelNode node) getTableName(org.apache.calcite.plan.RelOptTable table) Returns the qualified name of a table scan, otherwise returns empty.static booleanisAliasHint(String hintName) Check if the hint is a alias hint.static booleanisQueryHint(String hintName) Check if the hint is a query hint.Merges the dynamic table options fromhintsand static table options from table definitionprops.static org.apache.calcite.rel.RelNoderesolveSubQuery(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.static StringstringifyHints(List<org.apache.calcite.rel.hint.RelHint> hints)
-
Field Details
-
HINT_NAME_OPTIONS
- See Also:
-
HINT_ALIAS
- See Also:
-
LEFT_INPUT
- See Also:
-
RIGHT_INPUT
- See Also:
-
HINT_NAME_JSON_AGGREGATE_WRAPPED
Internal hint that JSON aggregation function arguments have been wrapped already. SeeWrapJsonAggFunctionArgumentsRule.- See Also:
-
-
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 hintstableHints, never null. -
mergeTableOptions
public static Map<String,String> mergeTableOptions(Map<String, String> hints, Map<String, String> props) Merges the dynamic table options fromhintsand static table options from table definitionprops.The options in
hintswould override the ones inpropsif they have the same option key.- Parameters:
hints- Dynamic table options, usually from the OPTIONS hintprops- Static table options defined in DDL or connect API- Returns:
- New options with merged dynamic table options, or the old
propsif there is no dynamic table options
-
getTableAlias
-
canTransposeToTableScan
public static boolean canTransposeToTableScan(org.apache.calcite.rel.RelNode node) -
getTableName
Returns the qualified name of a table scan, otherwise returns empty. -
stringifyHints
-
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
Check if the hint is a query hint. -
isAliasHint
Check if the hint is a alias hint.
-