CertLumen

Databricks Data Engineer Associate · Section 3 · 22% of the exam

Understand the basic tuning parameters (spark.sql.shuffle.partitions, spark.default.parallelism, spark.executor/driver.memory, spark.sql.autoBroadcastJoinThreshold) and re-measure the performance.

One of the objectives of the Databricks Certified Data Engineer Associate exam, in the section “Data Transformation and Modeling”. 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 notebook on a classic all-purpose cluster calls toPandas() on a 6 GB DataFrame and fails with a driver out-of-memory error. The engineer adds spark.conf.set("spark.driver.memory", "32g") as the first cell and reruns the notebook, and it fails again. What explains this, and what is the best fix?

  1. AThe setting takes effect after the next action, so running the cell twice before toPandas() fixes it.
  2. Bspark.driver.memory sizes the executor heap; set spark.executor.memory instead, as toPandas() runs on executors.
  3. CAQE overrides memory settings at runtime; disable AQE so that the new driver memory value can take effect.
  4. DDriver memory is fixed when the driver JVM starts; return less data to the driver or restart with a larger driver.
Show the answer

D. spark.driver.memory and spark.executor.memory are read when the JVMs launch, so changing them from a running session has no effect (runtime changes to core Spark configs are rejected). The real problem is collecting 6 GB to a single machine; the preferred fix is to return less data, and only if that is impossible to restart classic compute with a bigger driver.

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 Tuning Parameters & Measuring Performance (about 80 minutes), and 14 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 →