stream-processing-with-apache-flink
stream-processing-with-apache-flink copied to clipboard
Lookup join example is potentially wrong
Hi,
I'm going through the book and I think the lookup join query is incorrect.
SELECT
transactionId,
t.accountId,
t.eventTime_ltz,
TO_TIMESTAMP_LTZ(updateTime, 3) AS updateTime,
type,
amount,
balance,
districtId,
frequency
FROM transactions AS t
JOIN accounts FOR SYSTEM_TIME AS OF t.eventTime_ltz AS a
ON t.accountId = a.accountId;
As it is mentioned in the intro, a processing time attribute is required, however, in the example an event time field is used. On the Flink Dashboard it is also visible that the executed query is doing a temporal join. Switching to a field which is defined as PROCTIME() turns the query into a lookup join.
@xjmdoo thanks for highlighting this. For a lookup join the table needs to have a processing time attribute and the other table to be backed by a lookup source connector.
Will try and update ASAP