Sub topic 1
How Unity Catalog governs data and AI assets
Unity Catalog is the governance layer in Databricks. It holds one central definition of who can access which data and AI assets, and it enforces that definition on every query, notebook, and job that touches them. This chapter gives you the working model. Later chapters cover each part in detail.
Prerequisites
This chapter assumes you have:
- Basic SQL, including SELECT and CREATE statements.
- Familiarity with the Databricks workspace and either notebooks or the SQL editor.
- A general idea of users, groups, and role-based access control.
What Unity Catalog governs
Unity Catalog manages access to more than tables. Its securable objects (objects you can grant privileges on) include:
- Catalogs and schemas, which organize everything else.
- Tables and views.
- Volumes, which hold files.
- Functions and registered machine learning models.
- Storage credentials and external locations, which control access to cloud storage.
Because the definitions live in one place, a rule you set once applies in every workspace attached to the same metastore. The metastore is the top-level container that stores this metadata and the permissions.
The working model
Access control in Unity Catalog follows one pattern:
- A principal (a user, service principal, or group) sends a request.
- Unity Catalog finds the object being requested.
- It checks the privileges granted to the principal on that object, on its parents, and through the principal's group memberships.
- It allows or denies the request, and it writes an audit record.
Access is denied unless a privilege allows it. There are no deny rules. You build permissions only by granting, so removing access means revoking a grant.
A first example
To read a table, a principal needs privileges on the table and on each parent above it. The grants below give the group data-analysts read access to one table:
GRANT USE CATALOG ON CATALOG main TO `data-analysts`;
GRANT USE SCHEMA ON SCHEMA main.sales TO `data-analysts`;
GRANT SELECT ON TABLE main.sales.orders TO `data-analysts`;USE CATALOG and USE SCHEMA let the group reach the objects inside. They do not let it read any data. SELECT on the table is what allows reading. If you leave out one of the three, the query fails.
Where enforcement happens
Unity Catalog goes beyond table-level grants. It also supports these controls, each covered in its own chapter:
- Row filters and column masks, which change what a user sees inside a table.
- Dynamic views, which return different values depending on group membership.
- External locations, which govern access to files in cloud storage.
- Workspace bindings, which limit which workspaces can see a catalog.
Common errors
- Granting only SELECT. The query still fails because
USE CATALOGandUSE SCHEMAare missing on the parents. - Granting to individuals. Grants to single users are hard to review and maintain. Grant to groups instead.
- Assuming an old grant is gone. Privileges persist until someone revokes them. Check with
SHOW GRANTS ON TABLE main.sales.orders;. - Expecting a deny rule. Unity Catalog has none. Remove the grant that allows the access.
Exercise
A user belongs to a group that has SELECT on main.sales.orders, but the user's query on that table fails with a permission error. Which grants should you check, and why?
Show answer
Check that the group also has USE CATALOG on main and USE SCHEMA on main.sales. SELECT on the table is not enough, because the principal needs the parent privileges to reach the table. Also confirm the user is a member of the group, and run SHOW GRANTS on each object to see what is actually granted.