Mark Nuttall
09/04/2024, 1:19 PMCREATE TABLE parts (
`timestamp` TIMESTAMP(3),
`partid` STRING,
`region` INT,
WATERMARK FOR `timestamp` AS `timestamp`
) WITH (
'connector' = 'filesystem',
'path' = 'file:///prototypes/left-join/parts.json',
'format' = 'json'
);
CREATE TABLE partners (
`timestamp` TIMESTAMP(3),
`region` INT,
`partner` STRING,
WATERMARK FOR `timestamp` AS `timestamp`
) WITH (
'connector' = 'filesystem',
'path' = 'file:///prototypes/left-join/regions.json',
'format' = 'json'
);
If I select /*+ STATE_TTL('parts'='5m') */ * from parts left join partners on parts.region = partners.region;
sql-client (for Flink 1.19.1) says,
Flink SQL> select /*+ STATE_TTL('parts'='5m') */ * from parts left join partners on parts.region = partners.region;
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.ValidationException: The options of following hints cannot match the name of input tables or views:
`parts` in `STATE_TTL`
I'm sure I've followed the docs in https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/dev/table/sql/queries/hints/#state-ttl-hints but nothing I do seems to work. Are the docs wrong? Does sql-client not work? I'd be very grateful for any clues since I'm completely bewildered. Thank you!D. Draco O'Brien
09/05/2024, 5:56 PMD. Draco O'Brien
09/05/2024, 5:58 PMCREATE TABLE parts (
`timestamp` TIMESTAMP(3),
`partid` STRING,
`region` INT,
WATERMARK FOR `timestamp` AS `timestamp`
) WITH (
'connector' = 'filesystem',
'path' = 'file:///prototypes/left-join/parts.json',
'format' = 'json',
'state.ttl' = '5 min' -- Setting the state TTL here
);
Hải Nguyễn
09/06/2024, 1:24 AMselect /*+ STATE_TTL('parts'='5m') */ * from (select * from parts) parts left join partners on parts.region = partners.region;
Mark Nuttall
09/06/2024, 8:41 AMstate.ttl
isn't a valid option on the filesystem connector, but that's fine.) Can either of you comment on whether the docs https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/dev/table/sql/queries/hints/#state-ttl-hints are wrong, and should be corrected, or if it's in fact a bug in org.apache.flink.table.planner.plan.optimize.QueryHintsResolver.getNewStateTtlHintOptions()
or thereabouts? Many thanks again for your help.D. Draco O'Brien
09/06/2024, 11:42 AMD. Draco O'Brien
09/06/2024, 11:43 AMMark Nuttall
09/06/2024, 11:49 AMorg.apache.flink.table.api.ValidationException
, both in sql-client and a Java Table API-based version. Either the code, or the docs, or both would seem in error.D. Draco O'Brien
09/06/2024, 11:51 AMMark Nuttall
09/06/2024, 11:52 AMD. Draco O'Brien
09/06/2024, 11:54 AMD. Draco O'Brien
09/06/2024, 11:55 AMMark Nuttall
09/06/2024, 11:56 AMD. Draco O'Brien
09/06/2024, 11:59 AMD. Draco O'Brien
09/06/2024, 12:00 PMD. Draco O'Brien
09/06/2024, 12:00 PMD. Draco O'Brien
09/06/2024, 12:00 PMD. Draco O'Brien
09/06/2024, 12:01 PMD. Draco O'Brien
09/06/2024, 12:02 PMMark Nuttall
09/06/2024, 12:03 PMD. Draco O'Brien
09/06/2024, 12:04 PMMark Nuttall
09/09/2024, 10:26 AM