In FlinkSQL, when doing an <event-time temporal jo...
# troubleshooting
w
In FlinkSQL, when doing an event-time temporal join, is it possible to configure a TTL for the versioned table? I feel like this would work if we configure TTL for the whole job, but I would prefer to configure it only for that operator.
m
Not for event-time temporal joins per https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/dev/table/sql/queries/hints/#state-ttl-hints, only for regular joins and group aggregrations
w
But TTL at the job-level does work or TTL for event-time temporal joins is not supported at all? https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/concepts/overview/#different-ways-to-configure-state-ttl
m
At the job level it does work
w
Okay, good to know. Thanks Martijn πŸ™‚
Can I 'solve' the ttl for this with a filter for the versioned table? So for example:
Copy code
FROM telemetry_tbl AS l
LEFT JOIN versioned_tbl
FOR system_time AS OF l.timestamp AS r 
ON l.unique_id = r.unique_id
WHERE CURRENT_WATERMARK(r.timestamp) IS NULL
  OR TIMESTAMPADD(HOUR, 24, r.timestamp) > CURRENT_WATERMARK(r.timestamp)
such that it will keep the latest version of the versioned table up and until 24h after the last watermark?