Hi,
I am using the SQL api on Flink 1.18 and I am trying to write a SQL query
which uses a 'user-defined table aggregate function' (UDTAGG). However, the
documentation
<https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/dev/table/functions/udfs/>
[1] only includes a Table API example when it comes to UDTAGG. I tried
writing the query similar to a regular SQL query with a GROUP BY clause and
it does not work.

Can someone show how the below example query from the documentation can be
written in SQL?

env
  .from("MyTable")
  .groupBy($("myField"))
  .flatAggregate(call("Top2", $("value")).as("value", "rank"))
  .select($("myField"), $("value"), $("rank"));







[1]
https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/dev/table/functions/udfs/

Reply via email to