I have an Apache Beam job, which injest data from PubSub and then load into BigQuery, I transform PubSub message to pojo with fields
id, name, count
Count mean the count of not unique elements into single ingest.
If i load from PubSub 3 elements, two of which are same, then i need to load into BigQuery 2 elements, one of them will have count 2.
I wonder how easily make it in Apache Beam. I tried to make it wia DoFn or MapElements, but there i can process only single element. I also tried to convert element to KV, and then count, but i have non determenistics coder.
In usual java app i can simple use equals or via Map, but here in Apache beam all is different.