How Unity Catalog automatically transforms sensitive column values based on who's viewing them.
📖 Row Filters & Column Masks Documentation
The customers table contains SSN numbers — highly sensitive PII that not everyone should see.
Raw values: 123-45-6789, 987-65-4321, etc.
A mask function is applied to the SSN column:
CASE WHEN is_member('admins') THEN VALUE ELSE '***-**-' || SUBSTR(VALUE, -4) END
Sarah (Analyst) runs: SELECT name, ssn FROM customers
She's in the analysts group, but NOT in admins.
UC evaluates is_member('admins') → FALSE for Sarah.
Sarah sees: ***-**-6789 — the last 4 digits only.
Dave (Admin) runs the exact same query.
UC evaluates is_member('admins') → TRUE for Dave. He sees: 123-45-6789
Column masks transform values, not hide rows. Users still see the row, just with masked values.
is_member() function checks group membership to decide masking behavior.
Ideal for SSN, credit cards, health records — show partial info for verification.
Users run identical queries but see different values based on their groups.