Databricks Data Engineer Associate · Section 3 · 22% of the exam
Implement data cleaning by reading bronze tables with PySpark/SQL, cleaning nulls, standardizing data types, and writing to new silver tables.
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
The PySpark DataFrame API from zero: the SparkSession, reading files and tables with options and schemas, data types, column expressions with select/withColumn/filter/col/lit/expr, the functions module, display vs show, and writing tables with save modes.
Points to remember
sparkis predefined in Databricks; DataFrames are immutable and lazily evaluated.- Read with
spark.read.format(...).option(...).schema(...).load(path)orspark.read.table('catalog.schema.table'). - CSV defaults: no header, every column STRING;
inferSchemaadds an extra pass — prefer explicit schemas in production. - Parse modes: PERMISSIVE (default; bad fields → NULL /
_corrupt_record), DROPMALFORMED, FAILFAST. F.colreferences a column,F.litwraps a constant,F.exprembeds SQL; combine conditions with&,|,~and parentheses.
Try a question
A streaming query writes to a Delta table with .option('checkpointLocation', '/Volumes/workspace/dea_lab/checkpoints/orders'). What does Spark store in this location?
- AA copy of every row written to the target table, kept so the sink can be rebuilt after a failure
- BProcessed source offsets, a commit log of completed micro-batches and any operator state
- CThe target table's Delta transaction log, so the stream's writes are committed from this location
- DThe stream's Spark UI event logs and progress metrics, used by the streaming dashboard
Show the answer
B. The checkpoint records what has been read (offsets), which micro-batches were committed, and state for aggregations, joins or deduplication. On restart Spark resumes from the checkpoint; together with a replayable source and an idempotent sink such as Delta, this provides exactly-once processing.
Written for practice in the style of the exam: never a question from the real exam.
In the course
5 lessons teach this objective: PySpark DataFrame Essentials, Delta Lake Fundamentals, Structured Streaming Fundamentals, Medallion Architecture & Bronze→Silver Cleaning, Lakeflow Spark Declarative Pipelines (about 240 minutes), and 40 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
- 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 basic tuning parameters (spark.sql.shuffle.partitions, spark.default.parallelism, spark.executor/driver.memory, spark.sql.autoBroadcastJoinThreshold) and re-measure the performance.
- 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.