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.
PreviousBuild a small incremental pipeline that loads a CSV into a warehouse table with deduplication and a data quality check.Next Your Spark job on a 50-node cluster fails with executor lost and OOM during a groupBy. What do you check first?
More on Spark production scenarios
Flashcards for this topic- MediumYour Spark job on a 50-node cluster fails with executor lost and OOM during a groupBy. What do you check first?
- HardNightly job writes thousands of tiny Parquet files to S3 and downstream queries slow down. How do you fix it end to end?
- MediumA join between a 2 TB table and a 5 GB dimension is slow. What options do you consider?
- HardHow does Spark's Adaptive Query Execution change a plan at runtime?