internalsGet Pro

Module 08 · Lesson 10 of 14Pro

Data skew: when one task does all the work

Level
Advanced
Topic
Batch processing with Spark
Reading time
18 min

When you finish this page you can

  1. Explain why hash partitioning sends every row of a key to one task, and why the slowest task sets a stage’s time.
  2. Tell data skew from a slow machine using a stage’s task metrics, and find the hot keys with one query.
  3. Predict which skew Spark’s adaptive query execution fixes on its own, and which you must fix yourself.
  4. Choose between the REBALANCE hint, salting and handling hot keys apart, and say when splitting a key would change the answer.

Builds on 3 lessons

Start with lesson 617 min
  1. Shuffles: the most expensive step in Spark17 min
  2. Partitions and parallelism in Spark17 min
  3. Joins at scale: broadcast and sort-merge17 min

199 tasks done, one still running

is an online store in India. Its apps send about 200 million click events a day, which land in S3 as files. Meera, a data engineer on Kartly’s data team, runs the Spark jobs that turn them into data other teams read.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan