Github user fhueske commented on the issue:
https://github.com/apache/flink/pull/5555
Thanks for the pointer to FLINK-8690. I'll have a look and comment there.
Regarding the question of whether to directly embed `MapState` in the
generated code and remove the `DistinctAccumulator` or not, I think we should
keep it as it is for now.
We would have to add a field to the `Row` that stores the accumulators to
be able to store the `HashMap` which are used in the non-statebacked case.
Also, would need to change the return type of functions that return partial
aggregates to include the distinct maps. In the current approach, we have
everything nicely encapsulated in each accumulator. We can optimize the
solution later in a separate issue.
---