使用RichAggregateFunction时出现Flink错误 [英] Flink error on using RichAggregateFunction

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

问题描述

我正在尝试使用抽象

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆