Interview practice question
collect() crashed the driver
Data Engineering · Spark · Beginner
A developer ran df.collect() to check results on a 200 million row DataFrame, and the job crashed. What happened and what should they do instead?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- collect brings all rows to the driver's memory.
- The driver ran out of memory.
- Use show, limit or take for sampling.
- Use aggregations like count or describe to inspect.
- Write results to storage instead of collecting.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.