internalsGet Pro

Module 08 · Lesson 8 of 14Pro

Partitions and parallelism in Spark

Level
Intermediate
Topic
Batch processing with Spark
Reading time
17 min

When you finish this page you can

  1. Explain how partitions become tasks, and how tasks fill an executor’s cores in waves.
  2. Say where a DataFrame’s partition count comes from when Spark reads files, after a shuffle, and after repartition or coalesce.
  3. Size the shuffle partitions of a job from its shuffle data and its cores, and decide when to let adaptive query execution choose.
  4. Tell a folder partition in object storage apart from a Spark partition, and avoid the write patterns that turn one into thousands of small files.

Builds on 3 lessons

Start with lesson 317 min
  1. Spark architecture: driver, executors and tasks17 min
  2. Shuffles: the most expensive step in Spark17 min
  3. Partitioning files by date and key16 min

200 cores, one task running

is an online store in India. Its apps send about 200 million click events a day, and its data team lands them in S3 as files, one folder per day. Meera, a data engineer there, runs the Spark jobs that turn those files into tables the product and ML 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