Skip to content

Data Analyst Associate · Domain 9: Securing Data · 8% of the exam

Task 9.2: Apply best practices for storage and management to ensure data security, including table ownership and PII protection

Group ownership, managed tables, least privilege, and protecting personal data with row filters, column masks, dynamic views and ABAC policies.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Databricks documentation page that proves it.

Question 1 · choose 1

An analyst wants to give 30 finance analysts SELECT on the tables of main.finance. The only finance group she can find was created in the workspace admin settings as a workspace-local group, and her GRANT to it fails. Which approach follows Unity Catalog best practices?

  1. AGrant SELECT to each of the 30 analysts directly
  2. BCreate a new group in the account console, add the 30 analysts to it by hand, and grant SELECT to that group
  3. CUse an account-level group synced from the identity provider, and grant SELECT to that group
  4. DKeep the workspace-local group and grant it SELECT through the workspace's Catalog Explorer instead of SQL
Show the answer and why
  • AGrant SELECT to each of the 30 analysts directly

    Incorrect

    Databricks recommends avoiding direct grants to users whenever possible and granting to groups.

  • BCreate a new group in the account console, add the 30 analysts to it by hand, and grant SELECT to that group

    Incorrect

    An account-level group can receive the grant, but Databricks recommends defining and managing groups in the IdP and avoiding adding users manually.

  • CUse an account-level group synced from the identity provider, and grant SELECT to that group

    Correct

    Principals must be defined at the account level to be assigned privileges on Unity Catalog securables, and groups should come from the IdP.

  • DKeep the workspace-local group and grant it SELECT through the workspace's Catalog Explorer instead of SQL

    Incorrect

    The interface does not matter; workspace-level groups are not synced to the account, so they cannot receive Unity Catalog grants.

Unity Catalog grants go to principals defined at the Databricks account level. Users and service principals added to a workspace are synced to the account, but workspace-local groups are not and should be migrated. Databricks recommends defining and managing groups in the IdP rather than adding users by hand, avoiding direct grants to users, and granting through groups.

Question 2 · choose 1

Analysts must see the email column of main.crm.contacts masked, while members of the account group privacy_team see full values. Auditors on the privacy team also run weekly time travel queries on main.crm.contacts with VERSION AS OF. Which approach protects the column without breaking those queries?

  1. AA table-level column mask on email that checks membership in privacy_team
  2. BA dynamic view that masks email for non-members of privacy_team, granted to analysts
  3. CA column mask applied to a view over the table, leaving the table unchanged
  4. DA deep clone of the table with a column mask on the clone for the analysts
Show the answer and why
  • AA table-level column mask on email that checks membership in privacy_team

    Incorrect

    Time travel isn't supported with table-level row filters or column masks, so the auditors' queries would fail.

  • BA dynamic view that masks email for non-members of privacy_team, granted to analysts

    Correct

    A dynamic view masks columns at query time by group membership, and the base table has no mask, so time travel on it keeps working.

  • CA column mask applied to a view over the table, leaving the table unchanged

    Incorrect

    Row-level security and column masks cannot be applied to a view.

  • DA deep clone of the table with a column mask on the clone for the analysts

    Incorrect

    Deep and shallow clones are not supported on tables that have column masks.

Table-level row filters and column masks protect data at query time but bring limitations: time travel isn't supported with them, they cannot be applied to views, and clones are not supported on protected tables. A dynamic view gated by is_account_group_member() masks the column for analysts who query the view, while authorized users keep working with the base table.

Question 3 · choose 1

To protect PII, a team bound a different masking function to each of 40 columns of a large customer table, and queries on the table have become slow. What does Databricks recommend for column masks on large tables?

  1. AMask only the truly sensitive columns and reuse masking functions
  2. BAdd more expressions to each masking function so it can exit early
  3. CMove the masking rules into mapping tables the functions query
  4. DPass more columns as arguments to each function so it skips work
Show the answer and why
  • AMask only the truly sensitive columns and reuse masking functions

    Correct

    Each distinct mask is evaluated during queries, so Databricks recommends masking only truly sensitive columns and reusing functions.

  • BAdd more expressions to each masking function so it can exit early

    Incorrect

    Databricks recommends simple UDFs: functions with fewer expressions perform better.

  • CMove the masking rules into mapping tables the functions query

    Incorrect

    Simple CASE expressions are preferred over mapping tables or subqueries.

  • DPass more columns as arguments to each function so it skips work

    Incorrect

    Column references passed as UDF arguments cannot be optimized away; fewer arguments perform better.

Row filters and column masks keep users from seeing base values before they are filtered or masked, which can affect performance. Databricks recommends limiting the number of distinct column masks on large tables, because each distinct mask is evaluated during queries: apply masks only to truly sensitive columns and reuse masking functions where possible.

Question 4 · choose 1

A table owner wants the salary column of hr.employees masked for everyone not listed in hr.salary_viewers. Her mask function looks up the current user in hr.salary_viewers, a table that is itself protected by a row filter. What does the documentation say about this design?

  1. AIt works, and the lookup table's row filter is skipped inside the mask
  2. BIt works once analysts get SELECT on hr.salary_viewers as well
  3. CIt is not supported, since masks cannot reference filtered tables
  4. DIt works if the logic is moved into a row filter on hr.employees
Show the answer and why
  • AIt works, and the lookup table's row filter is skipped inside the mask

    Incorrect

    A mask cannot reference a table that has its own active row filter or column mask.

  • BIt works once analysts get SELECT on hr.salary_viewers as well

    Incorrect

    Privileges do not lift this limitation of row filters and column masks.

  • CIt is not supported, since masks cannot reference filtered tables

    Correct

    Row filters and column masks cannot reference tables that also have active row filters or column masks.

  • DIt works if the logic is moved into a row filter on hr.employees

    Incorrect

    Row filters have the same limitation: they cannot reference tables with active row filters or column masks.

Among the documented limitations of row filters and column masks, they cannot reference tables that also have active row filters or column masks. A table-level mask whose function looks up a table protected by its own row filter is therefore not supported.

Practice domain 9 →Practice all domains →