Databricks Certified Generative AI Engineer Associate Practice Questions

Databricks Certified Generative AI Engineer Associate exam preparation

Databricks Certified Generative AI Engineer Associate practice questions in English: 162 questions with explanations. The mock exam has 45 questions and 90 minutes.

Databricks Certified Generative AI Engineer Associate free question 9 / 10 · Domain 5: Governance

A team wants to replace person names and email addresses in the body column of customer inquiries with masked text before passing the text to an LLM. Writing it with SQL AI Functions, which expression matches the syntax and example in the Docs?

  1. ai_mask(array('person', 'email'), body)
  2. ai_mask(body, array('person', 'email'))
  3. ai_mask(body, 'person, email')
  4. ai_mask('person, email', body)
Show the answer and explanation

Answer: B

Why this is correct
ai_mask(content, labels) is a SQL function that finds and masks the specified kinds of information in text, using a chat model of Foundation Model APIs. The first argument, content, is the STRING expression to mask, and the second, labels, is an ARRAY<STRING> literal listing the kinds of information to mask. It returns a STRING with the specified information masked. In the Docs' example, passing array('person', 'email') gives a result such as "[MASKED] lives in New York. His email is [MASKED].", where only the found parts are replaced by [MASKED] and the rest of the sentence stays as it is.

Why the other options are wrong
"ai_mask(body, 'person, email')" … The order of arguments is right, but labels is defined as an ARRAY<STRING> literal. A single string with kinds separated by commas is not an array and does not fit the syntax. The kinds are grouped in array(...) and passed as the second argument.
"ai_mask(array('person', 'email'), body)" … The shape of labels is right, but the order of arguments is reversed. The syntax puts content first and labels second, so this expression puts the array of kinds where the text to mask goes and the body column where the list of kinds goes.
"ai_mask('person, email', body)" … The order of arguments is reversed and labels is not an array either. The string of kinds sits where the text to mask goes and the body column sits in the labels position, so it misses the syntax on both counts.

Key point
ai_mask keeps the shape of the sentence while masking, so the masked text can be passed straight on to an LLM or a later step. If content is NULL, the result is NULL. The labels in the Docs' examples include phone and address in addition to person and email. ai_mask is still described as Public Preview in the October 2026 Docs.

Go to the Databricks Certified Generative AI Engineer Associate practice app (10 free questions; purchase unlocks all questions)

See the full practice set