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
This is not a mistake on your side.
Flink doesn't support functions that extend RichAggregateFunction
in a group window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With