Try each one before opening the answer. Every option is explained, with the Databricks documentation page that proves it.
Question 1 · choose 1
A Lakeflow pipeline enriches support tickets by calling a custom model serving endpoint with ai_query. A few tickets make the endpoint return an error, and today that fails the whole update. The team wants the other rows to keep flowing and the failed tickets kept for a later retry. What should the data engineer do?
AWrap the ai_query call in try_cast
BAdd an expectation with ON VIOLATION FAIL UPDATE on the ai_query result
CRaise the job's task retries
DCall ai_query with failOnError => false and send rows whose errorMessage is not null to a retry table
Show the answer and why
AWrap the ai_query call in try_cast
Incorrect
try_cast handles values that cannot be cast; it does not catch errors returned by the endpoint call.
BAdd an expectation with ON VIOLATION FAIL UPDATE on the ai_query result
Incorrect
An expectation checks rows; it does not let failed inference rows continue to a retry table.
CRaise the job's task retries
Incorrect
Retrying the whole update hits the same failing rows again.
DCall ai_query with failOnError => false and send rows whose errorMessage is not null to a retry table
Correct
With failOnError set to false, ai_query returns a struct with the response and an error message, so failed rows can be separated.
failOnError defaults to true. When it is false, ai_query returns a STRUCT with the parsed response and an error message string; the message is null for rows that succeeded, so failures can be routed elsewhere.
A team wants to tag each support ticket as billing, technical or account without choosing a model, writing a prompt or creating an endpoint. Which function fits?
Aai_classify(ticket_text, labels)
Bai_query with a custom endpoint and prompt
Cai_summarize(ticket_text)
Dvector_search over the tickets
Show the answer and why
Aai_classify(ticket_text, labels)
Correct
ai_classify classifies text into labels you provide, using models maintained by Databricks.
Bai_query with a custom endpoint and prompt
Incorrect
ai_query is the general-purpose function for your own endpoints and prompts, which the team wants to avoid.
Cai_summarize(ticket_text)
Incorrect
ai_summarize returns a short summary of the text, not one of the given labels.
Dvector_search over the tickets
Incorrect
vector_search queries an AI Search index for similar items; it does not assign labels.
Task-specific AI Functions, such as ai_classify and ai_summarize, need no model selection or prompt and are recommended for getting started. ai_query is the general-purpose function for custom models and prompts.
A pipeline must pull the invoice number, invoice date and total from the text of each invoice into separate fields. Which function is built for this?
Aai_mask with the three field names as the entities
Bai_summarize with a word limit that fits three fields
Cparse_json on the invoice text
Dai_extract with a schema that names the three fields
Show the answer and why
Aai_mask with the three field names as the entities
Incorrect
ai_mask returns the text with the listed entities masked, not their values as separate fields.
Bai_summarize with a word limit that fits three fields
Incorrect
ai_summarize returns a summary of the text as one string, not a structured result.
Cparse_json on the invoice text
Incorrect
parse_json parses JSON strings, and invoice text is not JSON.
Dai_extract with a schema that names the three fields
Correct
ai_extract extracts structured data from text according to a schema, from simple field names to nested objects and types.
ai_extract returns structured data from text or parsed documents according to a schema you provide, from simple field names to rich schemas for documents such as invoices.
ai_query calls a chat foundation model to summarize reviews, and the next step needs the answer as JSON with fixed fields. Which ai_query argument enforces the output structure?
AreturnType with a STRING type for the reply
BresponseFormat set to a json_schema
CfailOnError => false
DmodelParameters with temperature set to 0
Show the answer and why
AreturnType with a STRING type for the reply
Incorrect
returnType describes the expected type, mainly for custom endpoints; it does not make a chat model follow a schema.
BresponseFormat set to a json_schema
Correct
responseFormat specifies the format a chat foundation model must follow, such as a JSON schema.
CfailOnError => false
Incorrect
failOnError does not shape the content of the response.
DmodelParameters with temperature set to 0
Incorrect
Temperature affects randomness, not structure.
For chat foundation models, the responseFormat argument enforces an output format, as text, json_object or json_schema, or as a DDL-style string.