You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by yunfan zhang <yu...@gmail.com> on 2024/01/23 04:04:32 UTC

[DISCUSS] One sql syntax mistake in flip204

Hi dev,

I am working on advancing the flip204 project, but I have noticed an error in the SQL syntax section. 
The sql syntax in the documentation is:

SELECT /*+ SHUFFLE_HASH('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 <http://c.id/>; 

In this SQL query, the 'Customers' table is renamed as 'c', but in the hint, the original table name 'Customers' is used. This approach is different from other query hints regarding table names in Flink. 
For other hints like LOOKUP or BROADCAST
, the syntax rule is to use the alias name if the table has one, and if not, to use its original table name. 
Therefore, I believe the correct syntax for the flip204 example should be:

SELECT /*+ SHUFFLE_HASH('c') */ 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 <http://c.id/>;