Databricks Data Engineer Professional · Section 3 · 12% of the exam
Apply AI functions, including ai_query, to perform model inference within data pipelines for enrichment and classification tasks.
One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Data Manipulation”. Here is what it covers, the points to remember and a question to try.
What it covers
Enrich and classify data inside pipelines with task-specific AI functions and ai_query (structured output, error handling, cost control), then guard every layer with Lakeflow Pipelines expectations that warn, drop, fail or route bad records to a quarantine table.
Points to remember
- Task-specific AI Functions (ai_classify, ai_extract, ai_analyze_sentiment, ai_summarize, ai_translate, ai_mask, ai_parse_document...) vs general-purpose
ai_querywith any endpoint. - AI Functions need DBR 15.4 LTS+ or a Pro/serverless SQL warehouse (not Classic) in a supported region; the owner needs CAN QUERY on the endpoint.
- ai_classify/ai_extract v2.x take JSON-string labels or schemas and return VARIANT; pin
map('version', '2.1'). responseFormatforces structured output and returns a JSON string to parse;failOnError => falsereturns STRUCT(response, errorMessage).- Batch inference: one query over the full dataset, Databricks-hosted foundation models; cost shows in system.billing.usage; score each row once with a streaming table.
Try a question
Support tickets must be routed into five business categories, each with a one-sentence description, using SQL with no model selection or prompt engineering. Which function fits best?
- A
ai_classifywith a JSON object of label names and descriptions - B
ai_analyze_sentiment, mapping each sentiment value to a category - C
ai_similaritybetween each ticket and the name of every category - D
ai_summarizewith a word limit, followed by a CASE expression
Show the answer
A. ai_classify is the task-specific function for assigning text to labels you define. Its v2 signatures accept the labels as a JSON array or as an object that maps each label to a description (2 to 500 labels), and return a VARIANT with the chosen label; a Databricks-managed model is used, so no endpoint or prompt is needed.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson AI Functions and Data Quality Expectations in Pipelines teaches this objective (about 50 minutes), and 15 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
- Apply advanced data transformations, including window functions, joins, and aggregations, using Spark SQL and PySpark to process large datasets.
- Develop a model and query semi-structured data using the VARIANT data type and related functions (e.g., parse_json, variant_get).
- Implement data quality expectations in Lakeflow Pipelines to quarantine, drop, or fail on bad records.