Databricks Data Engineer Professional · Section 1 · 23% of the exam
Choose between a streaming table and a materialized view for a given latency, cost, and refresh requirement.
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).cloudFilesinfers JSON/CSV as strings;read_filesdefaultsinferColumnTypesto 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 supportSCHEDULEandTRIGGER ON UPDATE.
Try a question
An SCD Type 1 AUTO CDC flow reads change files ingested by Auto Loader. Events for a key can arrive up to four days late and out of order. Auditors found customers who were deleted and then reappeared a few days later; in each case an update with an older sequence value than the delete arrived about three days after the delete. What fixes this?
- ASequence the flow by
_metadata.file_modification_timeso that events are applied in arrival order - BAdd
IGNORE NULL UPDATESso that late updates can't overwrite the deleted state of a customer - CSet
pipelines.cdc.tombstoneGCThresholdInSecondson the target above the four-day maximum delay - DStore the target as SCD Type 2 so that deleted keys can never be inserted again by later events
Show the answer
C. To handle out-of-order data, AUTO CDC keeps each deleted row temporarily as a tombstone, so an event with an older sequence value is recognised as stale. Tombstones are kept for two days by default; after that, a late older update looks like a new key and is inserted. Databricks recommends setting pipelines.cdc.tombstoneGCThresholdInSeconds above the maximum expected delay.
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
- Implement scalable Python project structures for Declarative Automation Bundles (formerly Databricks Asset Bundles / DABs) to support modular development and CI/CD integration.
- Apply troubleshooting techniques to dependency conflicts and installation failures for external libraries (PyPI, local wheels, source archives) across serverless, pipeline, and bundle-deployed environments.
- Develop User-Defined Functions (UDFs) using Pandas, Python, and SQL, including Unity Catalog functions for the given constraints.
- Create production-ready data pipelines for streaming data using Lakeflow Pipelines and Auto Loader.
- Create and automate ETL workloads using Lakeflow Jobs via the UI, API, and CLI.
- 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.
- Choose between Spark Structured Streaming and Apache Spark™ Declarative Pipelines for scalable ETL given operational constraints.
- Create Lakeflow Jobs that use control-flow operators such as If/Else conditions and For Each loops.
- Choose appropriate compute and configuration for environments and dependencies — including serverless compute (serverless environments, dependency management, performance mode), high-memory notebook tasks, and auto-optimization settings (e.g., disallowing retries).
- Develop unit and integration tests using assertDataFrameEqual, assertSchemaEqual, DataFrame.transform, and testing frameworks to ensure code correctness.
- Apply Structured Streaming stateful-processing semantics, including watermarks, output modes, foreachBatch, and checkpoints for fault-tolerant exactly-once state recovery.