Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
SELECT /*+ SHUFFLE_HASH('Orders', 'Customers') */ o.order_id, o.total, c.country, c.zip
FROM Orders AS o
JOIN Customers FOR SYSTEM_TIME AS OF o.proc_time AS c
ON o.customer_id = c.id;


Note:

  1. Table names in useSHUFFLE_hash HASH hint is required to avoid mistake hint propagation if there are multiple lookup joins.
  2. The hint only provides a suggestion to the optimization, it is not an enforcer.

...

Code Block
languagejava
titleUSESHUFFLE_HASH hint strategy
      builder
        .hintStrategy("SHUFFLE_HASH",
            HintStrategy.builder(
                HintPredicates.and(HintPredicates.CORRELATE, isLookupJoin(), lookupJoinWithFixedTableName())))
        .build();

...

LookupJoinRules would check whether FlinkLogicalJoin contain USESHUFFLE_HASH Hint. If yes, and the rules require the input must have hash distribution on join keys when converting FlinkLogicalJoin to LookupJoin.

...