Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to create custom hashmap accumulator in spark using java?

Highlighted

How to create custom hashmap accumulator in spark using java?

Rising Star

Hi All,
I want to create the custom hashmap accumulator in spark for one of my use case. I have already referred and implemented Accumulator as per code is given on below links but not found an end-to-end example for the same. I am trying to do it in java.
https://www.brosinski.com/post/extending-spark-accumulators/


Problem :
I want to know, How Can I increment value for each key in the same accumulator within foreach() transformation?