David Bryson
01/22/2024, 7:14 PMpyflink.util.exceptions.TableException: org.apache.flink.table.api.TableException: StreamPhysicalOverAggregate doesn't support consuming update and delete changes which is produced by node Rank(strategy=[UndefinedStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1],
I'm using the top-N from this article by ververica, and I have tried both the continuous top-N and window top-N: https://www.ververica.com/blog/flink-sql-recipe-window-top-n-and-continuous-top-n
What are my options here?Martijn Visser
01/22/2024, 7:16 PMDavid Bryson
01/22/2024, 7:17 PMMartijn Visser
01/22/2024, 7:19 PMDavid Bryson
01/22/2024, 7:26 PMMartijn Visser
01/22/2024, 7:45 PMDavid Bryson
01/22/2024, 7:54 PMMartijn Visser
01/22/2024, 7:58 PMDavid Bryson
01/22/2024, 8:05 PMSELECT
CASE
WHEN incoming > prev_topN THEN incoming
END as current_topN
topN as incoming,
LAG(topN, 1) as prev_topN
And that would bridge the windows to calculate topN as it hops. But maybe that's getting too complicated?
I really only need two values to calculate the above:
previously seen max value(previous window),
current max value over the windowMartijn Visser
01/22/2024, 8:09 PMDavid Bryson
01/22/2024, 8:11 PMCASE
WHEN i.signal > s.signal_max_prev THEN i.signal - s.signal_current_max
ELSE 0
END AS current_max_diff
This is the irreversible signal value, the incremental difference over the previously seen top-N and the current value.Martijn Visser
01/22/2024, 8:17 PMDavid Bryson
01/22/2024, 8:33 PMJaehyeon Kim
01/22/2024, 8:34 PMDavid Bryson
01/22/2024, 8:41 PMJaehyeon Kim
01/22/2024, 8:47 PMDavid Bryson
01/22/2024, 8:53 PMMatan Perelmuter
01/22/2024, 10:19 PMstream
.windowAll(SlidingEventTimeWindows.of(Time.hours(2), Time.minutes(5)))
.trigger(new OnElement())
.evictor(new TopNEvictor()) // implement
.process(...)
.sinkTo(...) // sink with window time as primary key