I'm currently working on a project where we have a ktable on which we apply a map-reduce pattern to the table using the groupBy() to map to a new key and then count(). We then emit changes onto a stream.
I would've expected that for every input event, we would only see one "count" event as output however this appears not to be the case. Instead, the first event emits a count of 1, then we update that key in the ktable, and we get two output events, the first with a count of 0 and the second with a count of 1.
I don't know if this is normal behaviour and the docs are unclear on this. If it is normal behaviour, how can I change this?
Code for reproducing the problem can be found here https://gist.github.com/officialpatterson/72a2bb8c5691c35a4ac960f4914f72dc