Skip to main content
Advancedcomparison Verified ~7 min

What is an accumulator, and why can its value be wrong?

Source: PySpark documentation

Quick answerFree

A shared variable that tasks can only add to and the driver can read, used for counters such as bad records. Spark guarantees each task's update is applied exactly once only for updates inside actions.

Detailed answer· ~220 words

Interview Prep

Unlock the full answer with Interview Prep

Get a ~220-word model answer, 3 key points, a visual explainer, 5 common mistakes and 5 follow-ups, plus 43 more Apache Spark questions.

Also in Pro (₹499 / 90 days).

Key points· 3 points

Interview Prep
Unlock with Interview Prep

Visual explainer· animated, step by step

Interview Prep
Unlock with Interview Prep

Common mistakes· 5

Interview Prep
Locked

Best practices· 5

Interview Prep
Locked

Likely follow-ups· 5 questions

Interview Prep
Unlock with Interview Prep

+ 43 more Apache Spark questions in Interview Prep, each with the full answer.

Discussion