CertLumen

Databricks Data Engineer Associate · Section 6 · 10% of the exam

Identify common performance bottlenecks such as data skew, shuffling, and disk spilling by interpreting stage-level metrics in the Spark UI.

One of the objectives of the Databricks Certified Data Engineer Associate exam, in the section “Troubleshooting, Monitoring, and Optimization”. Here is what it covers, the points to remember and a question to try.

What it covers

How Spark turns your code into distributed work: driver and executors, partitions, lazy evaluation, narrow vs wide transformations, shuffles, jobs/stages/tasks, and the optimization stack of Catalyst, Tungsten, AQE and Photon.

Points to remember

  • The driver plans and schedules; executors run tasks; each core runs one task at a time (task slot).
  • One task per partition per stage; file-scan partitions default to about 128 MB (spark.sql.files.maxPartitionBytes).
  • Transformations are lazy; actions (count, show, display, collect, writes) trigger jobs. groupBy is not an action.
  • Narrow = no data movement; wide (groupBy, join, distinct, orderBy, repartition) = shuffle = new stage.
  • Catalyst optimizes plans (predicate pushdown, column pruning, join selection); Tungsten adds code generation and memory efficiency.

Try a question

A batch job's duration has doubled since a new source was onboarded. In the Spark UI, the longest stage, a sort-merge join, shows most tasks finishing in under 30 seconds but one task running longer than 10 minutes. The task summary metrics show Min and Median shuffle read of about 400 MB and Max shuffle read of 5.4 GB. Which solution should reduce the job runtime with the least effort?

  1. ADouble the number of worker nodes so the long-running task gets more resources
  2. BLower spark.sql.shuffle.partitions from 200 to 50 so fewer, larger tasks run
  3. CConfirm AQE skew-join handling is enabled so the oversized partition is split at runtime
  4. DRewrite every join in the pipeline to use manually salted keys with 64 salt values per join key
Show the answer

C. One task reading 5.4 GB while the median task reads 400 MB is classic data skew on the join key. AQE skew-join handling splits a shuffle partition that is larger than both 5 times the median (2 GB here) and 256 MB into smaller tasks, removing the straggler without code changes. It is on by default but can be switched off by legacy cluster configs, so confirming it is the first step.

Written for practice in the style of the exam: never a question from the real exam.

In the course

2 lessons teach this objective: Apache Spark Architecture, Spark UI & Performance Bottlenecks (about 90 minutes), and 22 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 29 objectives · Next objective →