CertLumen

Databricks Data Engineer Associate · Section 7 · 15% of the exam

Understand column-level masking and row-level security to restrict data visibility based on user groups.

One of the objectives of the Databricks Certified Data Engineer Associate exam, in the section “Governance and Security”. Here is what it covers, the points to remember and a question to try.

What it covers

Row filters hide rows and column masks transform values at query time, using SQL UDFs that check who is querying. This lesson covers the SQL to attach and remove them, identity functions, the older dynamic-view pattern, required privileges, and the limitations that show up in exam questions.

Points to remember

  • Row filter = SQL UDF returning BOOLEAN, attached with ALTER TABLE t SET ROW FILTER fn ON (col, …); FALSE or NULL hides the row; one filter per table.
  • Column mask = SQL UDF whose first parameter is the column, attached with ALTER TABLE t ALTER COLUMN c SET MASK fn [USING COLUMNS (…)]; one mask per column.
  • Detach with DROP ROW FILTER or ALTER COLUMN c DROP MASK before dropping the function, or the table becomes inaccessible.
  • Use is_account_group_member() for account groups and current_user() for the user's email; is_member() is workspace-local and legacy.
  • Attaching a filter or mask needs EXECUTE on the function plus table ownership or MANAGE + SELECT on the table.

Try a question

A column mask function on address needs the row's country value as well to decide whether to redact. How is country passed to the function?

  1. AALTER TABLE t ALTER COLUMN address SET MASK fn USING COLUMNS (country)
  2. BALTER TABLE t ALTER COLUMN address SET MASK fn ON (address, country)
  3. CALTER TABLE t SET MASK fn ON (address, country)
  4. DMasks receive just the masked column, so look up country inside the function with a subquery
Show the answer

A. The masked column is bound automatically to the first parameter, and additional columns or constant literals are passed in order with USING COLUMNS (…). The ON (…) clause belongs to row filters.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Row Filters & Column Masks teaches this objective (about 45 minutes), and 12 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

← Previous objective · All 29 objectives · Next objective →