CertLumen

Databricks Data Engineer Professional · Section 1 · 23% of the exam

Implement CDC pipelines using AUTO CDC APIs (formerly APPLY CHANGES) in Lakeflow Pipelines, including SCD Type 1 and Type 2 via stored_as_scd_type.

One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Developing Code for Data Processing using Python and SQL”. Here is what it covers, the points to remember and a question to try.

What it covers

Build a production streaming pipeline in Lakeflow Spark Declarative Pipelines: ingest files with Auto Loader and a deliberate schema-evolution policy, choose streaming tables or materialized views from latency, cost and refresh needs, and apply change data with AUTO CDC as SCD Type 1 or Type 2.

Points to remember

  • Lakeflow pipelines = Apache SDP (Spark 4.1+) plus AUTO CDC, expectations, queryable event log, update flows, foreachBatch sinks and continuous mode.
  • In pipelines, Auto Loader needs no schemaLocation or checkpoint; it gives exactly-once file ingestion but no file-order guarantee.
  • schemaEvolutionMode: addNewColumns (default without schema; fails then resumes), rescue, failOnNewColumns, none (default with schema). cloudFiles infers JSON/CSV as strings; read_files defaults inferColumnTypes to true.
  • Streaming table: each row once, append-only source, low latency, logic changes affect new rows only. Materialized view: always correct, reflects updates and deletes.
  • MV incremental refresh needs serverless; REFRESH POLICY AUTO | INCREMENTAL | INCREMENTAL STRICT | FULL; standalone MV/ST support SCHEDULE and TRIGGER ON UPDATE.

Try a question

orders_enriched is a streaming table that joins STREAM(orders) to the customers dimension to add each customer's segment. Marketing reclassifies segments every month, and analysts require every historical order to show the customer's current segment, without anyone running manual full refreshes. What should the engineer change?

  1. ARead customers with skipChangeCommits so that segment updates no longer interrupt the stream
  2. BDefine orders_enriched as a materialized view, which reflects dimension changes on each refresh
  3. CChange the stream-static join into a stream-stream join with a watermark on both of its inputs
  4. DAdd TRACK HISTORY ON segment to the streaming table so that earlier rows are updated in place
Show the answer

B. A streaming table processes each order once: a stream-static join uses the dimension as it is at that moment and never recomputes rows already written, so old orders keep the old segment. A materialized view is kept correct with respect to all its sources on every refresh, including changed dimension rows, incrementally where possible.

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

In the course

The lesson Lakeflow Pipelines: Auto Loader, Streaming Tables vs Materialized Views, AUTO CDC teaches this objective (about 60 minutes), and 19 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 45 objectives · Next objective →