Hi Jing, I'm afraid there is no possible to Window TopN in SQL on 1.12 version because window TopN is introduced since 1.13.
> I saw the one possibility is to create a table and insert the aggregated data to the table, then do top N like [1]. However, I cannot make this approach work because I need to specify the connector for this table and I may also need to create another kafka topic for this. I didn't understand you here. Do you mean you need a sink to store output data of TopN? However, you still need a sink to store the output even you use Window TopN. [1] https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/queries/window-topn/ Best, Jing Zhang Jing <[email protected]> 于2021年12月23日周四 16:12写道: > Hi, Flink community, > > Is there any existing code I can use to get the window top N with Flink > 1.12? I saw the one possibility is to create a table and insert the > aggregated data to the table, then do top N like [1]. However, I cannot > make this approach work because I need to specify the connector for this > table and I may also need to create another kafka topic for this. Is there > any existing way to do the Window Top N with Flink 1.12? > > [1] > https://nightlies.apache.org/flink/flink-docs-release-1.12/dev/table/sql/queries.html#top-n > > > Thanks, > Jing >
