Wei Ding
01/10/2024, 3:37 AM1.18 can run form the execution plan, however tuning Top-N state is not supported.
For example for a detailed case: How to deduplicate the logs using Top-N (Top-1) for only 1 hour?
The example query on the doc:
https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/dev/table/sql/queries/window-deduplication/
SELECT [column_list]
FROM (
SELECT [column_list],
ROW_NUMBER() OVER (PARTITION BY window_start, window_end [, col_key1...]
ORDER BY time_attr [asc|desc]) AS rownum
FROM table_name) -- relation applied windowing TVF
WHERE (rownum = 1 | rownum <=1 | rownum < 2) [AND conditions]
Many thanks.Wei Ding
01/13/2024, 6:05 AMrows between interval '1' hour preceding and current row to limit the state size.David Bryson
01/17/2024, 3:55 AMWei Ding
01/17/2024, 5:02 AMDavid Bryson
01/17/2024, 5:03 AMDavid Bryson
01/17/2024, 5:04 AMWei Ding
01/17/2024, 5:04 AMThe regular deduplication did not work in my case (I can not control the state size).Oh I hit an error that,
row_number() can not work together with rows and range.David Bryson
01/17/2024, 5:04 AMDavid Bryson
01/17/2024, 5:05 AMWei Ding
01/17/2024, 5:05 AMDavid Bryson
01/17/2024, 5:06 AMWei Ding
01/17/2024, 5:06 AMI will try windowing the query tomorrow as wellCould you keep me posted if you manage to solve this?
Wei Ding
01/17/2024, 5:08 AMI don't think I have access to thatIt's a public slack, everyone can join. But I'll also keep you updated.
David Bryson
01/17/2024, 5:08 AM