Adesh Dsilva
09/29/2023, 12:09 PMid name order_field country
100 abc 1 ABC
101 def 1 DEF
100 abc 2 GHI
Now if I group by
Table
.groupBy($("id"), $("name"))
I might get
id name order_field country
100 abc 2,1 GHI, ABC
101 def 1 DEF
Now I want
id name order_field country
100 abc 1 ABC
101 def 1 DEF
Basically I want to order by order_field and then get the first result. How can I do this in Table API in flink?Adesh Dsilva
09/29/2023, 2:22 PMcallSql("ROW_NUMBER() OVER (PARTITION BY id,name ORDER BY order_field ASC)").as("rank")
The only way I found was doing this but I dont want to use SQL query. I want to do this in Table API in java code. Can someone help?