Hi,

Some functions only exist in the SQL interface and are missing from the
Table API. For example LAST_VALUE(expression) [1]

I still want to use this function in my aggregation, and I don't want to
implement a user-defined function. Can I combine an SQL expression inside
my Table API?

For example:

val table = tenv
      .fromDataStream(stream)
      .groupBy($"name")
      .select($"name", $"products".count(), $"LAST_VALUE(age)")

If not - how can I get the last value of a column inside an aggregation?

Thanks.

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/functions/systemFunctions.html#aggregate-functions

Reply via email to