Sub topic 1
Unity Catalog in brief: securables, privileges, and the metastore
Prerequisites
This chapter assumes you know basic SQL (SELECT, WHERE, joins) and have used a Databricks workspace, notebook, or SQL warehouse. You should recognize the three-level namespace catalog.schema.table and have seen a GRANT statement. No lineage or audit knowledge is needed. Later chapters build on the model described here.
Why governance comes first
Lineage and audit logs are features of Unity Catalog. They only make sense once you know what Unity Catalog governs and how it decides who may do what. Both features record activity against objects that Unity Catalog manages, and both are exposed through tables that are themselves protected by Unity Catalog privileges.
The metastore
The metastore is the top-level container for Unity Catalog metadata. It stores the definitions of objects and the permissions on them. One metastore is normally created per cloud region, and many workspaces can be attached to it. Because workspaces share the metastore, one set of permissions applies in all of them, and activity from all of them can be recorded together.
Securables
A securable is any object that you can grant access to. Securables form a hierarchy.
A full table name has three parts, such as main.sales.orders. The parts are the catalog (main), the schema (sales), and the table (orders). Lineage and audit data identify objects by these full names.
Privileges and inheritance
A privilege is a permission on a securable, for example SELECT to read a table. Privileges are given with GRANT to a principal, which is a user, a group, or a service principal.
Privileges are inherited downward. If you grant SELECT on a schema, the principal can read every current and future table in that schema. To reach an object, a principal also needs USE CATALOG on the parent catalog and USE SCHEMA on the parent schema. Without them, SELECT on the table alone is not enough.
GRANT USE CATALOG ON CATALOG main TO `analysts`;
GRANT USE SCHEMA ON SCHEMA main.sales TO `analysts`;
GRANT SELECT ON TABLE main.sales.orders TO `analysts`;Granting to groups instead of individuals keeps access reviews manageable, a point that matters again in the audit chapters.
| Privilege | Applies to | What it allows |
|---|---|---|
| USE CATALOG | Catalog | Look inside the catalog |
| USE SCHEMA | Schema | Look inside the schema |
| SELECT | Table, view | Read data |
| MODIFY | Table | Insert, update, delete data |
Ownership
Every securable has an owner, who can grant and revoke privileges on it. Ownership is separate from the privilege list, so an owner does not appear as a GRANT row. Remember this when you later review who has access to an object.
The system catalog
Unity Catalog also exposes governance data through a built-in catalog named system. Its schemas hold read-only tables, including system.access.table_lineage, system.access.column_lineage, and system.access.audit. These tables follow the same permission model as your own data. Ordinary users do not get access by default, so an administrator must grant it. The next chapters cover what each table contains.
Common errors
- Permission denied on a table you were granted. Check
USE CATALOGandUSE SCHEMAon the parents first. - Granting to individuals. Access then drifts as people change roles. Use groups.
- Assuming each workspace has its own permissions. Permissions belong to the metastore, so they apply in every attached workspace.
Exercise
A user holds SELECT on main.sales.orders but gets a permission error when querying it. Name two privileges to check, and the object each applies to.
Show answer
Check USE CATALOG on the catalog main and USE SCHEMA on the schema main.sales. SELECT on the table is not enough without both parent privileges.