Skip to content

A scenario for a platform engineer · Mid level and up

Each region may see only its own sales

Vault · Security
Tuesday, 13:30

Twelve regional managers query one sales table in Unity Catalog on Databricks. Each of them may see only the rows of their own region, and head office sees everything.

What do you do?

Tap the one you would do. The answer opens below.

Show the best call

Put a row filter on the table: a function that compares the reader's group with the region column.

One table and one rule. Every query and notebook gets only the rows its reader may see. A dashboard does too, once it is published with individual data permissions.

Why

A row filter in Unity Catalog is a function attached to a table. It is checked for every row a query reads, and a row is shown only when the function returns true for whoever runs the query. A dashboard published with shared data permissions runs as its publisher, so publish it with individual data permissions. A table has one row filter. When the same rule is needed on many tables, an ABAC policy can apply it by tag.

Read it in the Databricks docs (opens in a new tab)

The other two

Works, at a price. Create one view per region, and grant each manager their own view.
It works. There are twelve views to keep right, a thirteenth with every new region, and the table itself has to stay closed to all of them.
A poor call. Copy each region's rows into a table of its own every night.
Twelve copies, a day old, that drift from the source. Their numbers stop adding up to head office's.

The words in this scenario

Unity Catalog.
The part of Databricks that governs data: who may see and change which tables and files, where data came from, and who did what. In the docs (opens in a new tab)

Go deeper on brickster.ai

More scenarios

Had one like this at work? Send it to us: the best tickets come from real incidents.

Added on . Checked against the Databricks documentation on . brickster.ai is independent and is not affiliated with Databricks.