FREE STUDY NOTES · DP-750

Row filters and column masks in Unity Catalog

How SQL UDF row filters and column masks restrict data per user, and how they differ from dynamic views.

From Ultra Transcenders DP-750 by Tony Rough (coming November 2026)

Table-level row filters and column masks attach security logic directly to a table, so every query on that table is filtered without creating a new object. They are managed per table with ALTER TABLE.

A row filter is a SQL user-defined function (UDF) that returns a boolean; rows for which it returns FALSE are excluded. A column mask is a SQL UDF that receives the column value and returns either it or a masked version; the return type must match or be castable to the column type. A table has at most one row filter, and each column has at most one mask.

CREATE FUNCTION main.sec.us_filter(region STRING)
RETURN IF(is_account_group_member('admin'), true, region = 'US');
ALTER TABLE main.sales.orders SET ROW FILTER main.sec.us_filter ON (region);

CREATE FUNCTION main.sec.ssn_mask(ssn STRING)
RETURN CASE WHEN is_account_group_member('hr') THEN ssn
            ELSE '***-**-****' END;
ALTER TABLE main.hr.people ALTER COLUMN ssn SET MASK main.sec.ssn_mask;

Syntax details:

Permissions: to assign a function you need EXECUTE on it plus USE SCHEMA and USE CATALOG; on an existing table you must be the owner or hold both MANAGE and SELECT; adding a masked column in the same statement also needs MODIFY.

Compute: a SQL warehouse, standard access mode on Runtime 12.2 LTS or above, or dedicated access mode on Runtime 15.4 LTS or above (with serverless enabled; writes on dedicated compute need 16.3 or above and must use supported patterns such as MERGE INTO). Runtimes below 12.2 fail securely and return no data.

Limitations to know:

Common trap: Running DROP FUNCTION on a filter that is still attached - the table becomes inaccessible; run ALTER TABLE ... DROP ROW FILTER (or DROP MASK) first.

Get the whole book

This note is one section of Ultra Transcenders DP-750: Implementing Data Engineering Solutions Using Azure Databricks, an independent study guide that explains every topic the exam covers by technology, with comparison tables, diagrams and the common traps, plus a glossary linked to Microsoft Learn.

Amazon.co.ukKindle: coming soonPaperback: coming soon
Amazon.comKindle: coming soonPaperback: coming soon

Due on Amazon in November 2026, in Kindle and paperback editions.

About the book · DP-750 terms in the glossary · All DP-750 study notes

More DP-750 study notes