Flink error on using RichAggregateFunction

筅森魡賤 提交于 2019-12-14 03:48:06

问题


I am trying to use an implementation of the abstract RichAggregateFunction in Flink. I want it to be "rich" because I need to store some state as part of the aggregator, and I can do this since I have access to the runtime context. My code is something like below:

stream.keyBy(...)
   .window(GlobalWindows.create())
   .trigger(...)
   .aggregate(new MyRichAggregateFunction());

However, I get an UnsupportedOperationException saying

This aggregation function cannot be a RichFunction.

I'm clearly not using RichAggregateFunction correctly. Is there any example of how to properly use it? Or should I be using a ProcessFunction for this sort of operation?

Thanks


回答1:


This is not a mistake on your side.

Flink doesn't support functions that extend RichAggregateFunction in a group window.



来源:https://stackoverflow.com/questions/47437207/flink-error-on-using-richaggregatefunction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!