问题描述
我正在尝试使用抽象 RichAggregateFunction .我希望它变得富有".因为我需要将某些状态存储为聚合器的一部分,并且可以执行此操作,因为我可以访问运行时上下文.我的代码如下:
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());
但是,我收到一个UnsupportedOperationException说
However, I get an UnsupportedOperationException saying
我显然没有正确使用RichAggregateFunction.是否有任何有关如何正确使用它的示例?还是应该使用ProcessFunction进行此类操作?
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?
谢谢
推荐答案
这并不是您的错误.
Flink不支持在组窗口中扩展RichAggregateFunction
的功能.
Flink doesn't support functions that extend RichAggregateFunction
in a group window.
这篇关于使用RichAggregateFunction时出现Flink错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!