JingsongLi opened a new pull request, #1770:
URL: https://github.com/apache/incubator-paimon/pull/1770

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... 
-->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   
   For Flink Lookup Join:
   
   ### Retry Lookup
   
   If the records of `Orders` (main table) join missing because the 
corresponding data of `customers` (lookup table) is not ready.
   You can consider using Flink's [Delayed Retry Strategy For 
Lookup](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/queries/hints/#3-enable-delayed-retry-strategy-for-lookup).
   Only for Flink 1.16+.
   
   ```sql
   -- enrich each order with customer information
   SELECT /*+ LOOKUP('table'='c', 'retry-predicate'='lookup_miss', 
'retry-strategy'='fixed_delay', 'fixed-delay'='1s', 'max-attempts'='600') */
   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;
   ```
   
   ### Async Retry Lookup
   
   The problem with synchronous retry is that one record will block subsequent 
records, causing the entire job to be blocked.
   You can consider using async to avoid blocking.
   
   ```sql
   -- enrich each order with customer information
   SELECT /*+ LOOKUP('table'='c', 'retry-predicate'='lookup_miss', 
'async'='true', 'output-mode'='allow_unordered', 
'retry-strategy'='fixed_delay', 'fixed-delay'='1s', 'max-attempts'='600') */
   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;
   ```
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to