I would like to select last element of processing window using FlinkSQL. Tried to achieve that with ROW_NUMBER
in Blink planner. Tried following query:
SELECT * FROM (
SELECT key, value, ROW_NUMBER() OVER w AS rn
FROM InputTable
WINDOW w AS (PARTITION BY key, TUMBLE(rt, INTERVAL '15' MINUTE) ORDER BY -ts)
) WHERE rn = 1
// rt = ts.rowtime, ts is Long
Unfortunately, this causes exception
org.apache.flink.table.planner.codegen.CodeGenException: Unsupported call: TUMBLE(TIMESTAMP(3) *ROWTIME*, INTERVAL SECOND(3) NOT NULL)
If you think this function should be supported, you can create an issue and start a discussion for it.
Any idea what am I doing wrong? I was thinking about TUMBLE
function as something "equivalent" to calculating rowtime % interval
.