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.groupByis 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?
- AThe setting takes effect after the next action, so running the cell twice before
toPandas()fixes it. - B
spark.driver.memorysizes the executor heap; setspark.executor.memoryinstead, astoPandas()runs on executors. - CAQE overrides memory settings at runtime; disable AQE so that the new driver memory value can take effect.
- 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
- Implement data cleaning by reading bronze tables with PySpark/SQL, cleaning nulls, standardizing data types, and writing to new silver tables.
- Combine DataFrames with operations such as Inner join, left join, broadcast join, multiple keys, cross join, union, and union all.
- Manipulate columns, rows, and table structures by adding, dropping, splitting, renaming column names, applying filters, and exploding arrays.
- Perform data deduplication operations and aggregate operations on DataFrames, such as count, approximate count distinct, and mean, summary.
- Understand the difference between, and how to build, Gold layer objects such as materialized views, views, streaming tables, and tables for BI and analytics teams in Unity Catalog.
- Apply data quality checks and validation rules to ensure reliable Silver and Gold datasets.