Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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());

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

like image 890
victtim Avatar asked Nov 22 '17 14:11

victtim


1 Answers

This is not a mistake on your side.

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

like image 172
Fabian Hueske Avatar answered Nov 12 '22 17:11

Fabian Hueske