使用RichAggregateFunction时出现Flink错

使用RichAggregateFunction时出现Flink错

本文介绍了使用RichAggregateFunction时出现Flink错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用抽象 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错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 17:19