Hi, The exception in the above StackOverflow link because built-in last_value agg function class ( `LastValueAggFunction`) does not support merge method. While you use session window aggregate, `merge` is required when merge two windows into one session window. [image: image.png] *You could define your UserDefined AggregateFunction [1] to walk around. Please implement `merge` method in the UserDefined Aggregate Function if they would be used in Session Window. *
[1] https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/table/functions/udfs/#aggregate-functions Best regards, JING ZHANG Caizhi Weng <tsreape...@gmail.com> 于2021年9月1日周三 上午10:42写道: > Hi! > > Yes it is, by using the last_value() aggregate function. For example > > SELECT last_value(v) FROM T GROUP BY k, session(ts, interval '1' minute) > > Michał Rudko <michal.ru...@getindata.com> 于2021年8月31日周二 下午11:40写道: > >> Hi, >> >> I had trouble to find in the documentation of Flink/Ververica which >> aggregations or analytical functions are supported within such SESSION >> WINDOW. In particular - I would like to capture the last value of a >> certain field. Is it possible? >> I have included all the details in StackOverflow here >> <https://stackoverflow.com/questions/68925461/how-to-get-last-value-in-a-session-window-in-flinksql> >> - >> so far without any answers. >> In case it's not doable, any workarounds would be appreciated. >> >> Thanks! >> >> -- >> >> Pozdrawiam / Regards >> >> >> Michał Rudko >> >> Big Data Consultant | Getindata >> [image: Getindata] >> M: +48 697 712 120 >> E: michal.ru...@getindata.com >> A: Puławska 39/20, Warsaw >> Website <https://getindata.com/> - Blog >> <https://medium.com/getindata-blog> - Twitter >> <https://twitter.com/getindata> >> >