I am using Flink SQL to handle batch case. How can I get the top-n record per group using FLINK SQL?
Flink SQL (until version 1.7) does not provide a built-in aggregation function for top-n.
You can implement a user-defined aggregation function to support you use case.