Github user fhueske commented on the issue:
https://github.com/apache/flink/pull/4674
Thanks for the info @hequn8128! As I said before, I don't mind making
`SingleElementIterable` `Serializable`. However, we have to ensure that the
property also holds. `element: T` is not necessarily serializable so the
serialization might fail. We can not easily declare `T` as `Serializable`
because that would mean to change the interface of the `AggregateFunction` and
enforce serializabiliy on the accumulators.
I see two options:
- declare the `element` field as `transient` and ensure that the
`SingleElementIterable` is only used in a context where it is OK to lose
`element` during serialization.
- override the default de/serialization methods and serialize `element`
using a `TypeSerializer`.
What do you think?
Best, Fabian
---