使用RichAggregateFunction时出现Flink错误 [英] Flink error on using 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
此聚合函数不能是RichFunction.
This aggregation function cannot be a RichFunction.
我显然没有正确使用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错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!