我在Flink SQL (1.13)中使用会话窗口。是否有方法(必须在SQL中,没有UDF等)获取某个字段的最后一个值(换句话说:这将是window_end的值)?我正在尝试:
SELECT user_account_id,
SESSION_START(request_timestamp, INTERVAL '30' MINUTE) AS window_start,
SESSION_END(request_timestamp, INTERVAL '30' MINUTE) AS window_end,
LAST_VALUE(package)
GROUP BY SESSION(request_timestamp, INTERVAL '30' MINUTE), user_account_id但是我得到了一个错误:
Could not find an implementation method 'merge' in class 'org.apache.flink.table.planner.functions.aggfunctions.LastValueAggFunction' for function 'LAST_VALUE' that matches the following signature:
void merge(org.apache.flink.table.data.RowData, java.lang.Iterable)我想使用窗口函数(OVER(...))在这里是行不通的。任何提示都很感谢!
发布于 2021-09-01 12:15:09
我得到的答案是这还不受支持。一种解决方法是创建自定义user-defined aggregate function (UDAGG)。除此之外,还有一个用于该功能的新Jira。
https://stackoverflow.com/questions/68925461
复制相似问题