CertLumen

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

  • spark is predefined in Databricks; DataFrames are immutable and lazily evaluated.
  • Read with spark.read.format(...).option(...).schema(...).load(path) or spark.read.table('catalog.schema.table').
  • CSV defaults: no header, every column STRING; inferSchema adds an extra pass — prefer explicit schemas in production.
  • Parse modes: PERMISSIVE (default; bad fields → NULL / _corrupt_record), DROPMALFORMED, FAILFAST.
  • F.col references a column, F.lit wraps a constant, F.expr embeds 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?

  1. AA copy of every row written to the target table, kept so the sink can be rebuilt after a failure
  2. BProcessed source offsets, a commit log of completed micro-batches and any operator state
  3. CThe target table's Delta transaction log, so the stream's writes are committed from this location
  4. 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

← Previous objective · All 29 objectives · Next objective →