Skip to content

MediumScenarioSpark production scenarios

A Spark job's last stage has one task running 40 minutes while 199 others finish in 1 minute. How do you diagnose and fix it?

What a good answer covers

This is data skew. Check the Spark UI task-duration and shuffle-read distribution, find the hot key, then fix it with salting, a broadcast join for the small side, or AQE skew-join handling (spark.sql.adaptive.skewJoin.enabled). Also filter null or default keys that pile into a single partition.

More on Spark production scenarios

Flashcards for this topic