Databricks Machine Learning Associate · Section 4 · 12% of the exam
Identify how streaming inference is performed with Delta Live Tables
One of the objectives of the Databricks Certified Machine Learning Associate exam, in the section “Model Deployment”. Here is what it covers, the points to remember and a question to try.
What it covers
Apply an MLflow model to a stream of new records. The exam guide calls the tool Delta Live Tables; today it is Lakeflow Spark Declarative Pipelines. Load the model as a Spark UDF, call it in a streaming table definition, configure the pipeline's environment and channel, and compare the pipeline approach with a hand-written Structured Streaming job and with calling a serving endpoint.
Points to remember
- Streaming inference = apply the model as a Spark UDF (
mlflow.pyfunc.spark_udf) to a streaming DataFrame; each new row is scored once. - Delta Live Tables is now Lakeflow Spark Declarative Pipelines;
import dltbecamefrom pyspark import pipelines as dp. @dp.tablereturningspark.readStream.table(...)defines a streaming table;@dp.materialized_viewwith a batch read defines a materialized view.- Create the UDF once at the top of the source file and call it inside the dataset function with
struct(*features). - Dataset functions return a DataFrame only: no
collect,toPandas,saveAsTable,startortoTable.
Try a question
Smart meters send up to 30,000 readings per second, and the volume changes by a factor of ten between night and day. An anomaly detection model registered in Unity Catalog must score every reading within minutes, and the team wants compute that resizes automatically with minimal operational work. Which design best meets these requirements?
- AA Structured Streaming notebook job on fixed-size compute that applies the model with
spark_udf - BA streaming job that calls a Model Serving endpoint over REST for every reading
- CA Lakeflow Spark Declarative Pipelines (DLT) pipeline that applies the model as a Spark UDF
- DA nightly batch job that scores the previous day's readings with pandas
Show the answer
C. A declarative pipeline applies the model as a Spark UDF inside a streaming table and manages checkpoints, retries and scaling. Serverless pipelines always use enhanced autoscaling, which adds and removes compute as the streaming load changes, so the fluctuating volume is handled without manual sizing.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Streaming Inference with Lakeflow Spark Declarative Pipelines teaches this objective (about 35 minutes), and 8 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.