Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of the accumulator in Spark?
Answer: An accumulator is a variable that can be added to and is used in Spark to implement counters and sums in a parallel and fault-tolerant manner across distributed tasks.

Example:

val accumulator = sc.longAccumulator("MyAccumulator")
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook