Identity system tables reference
This feature is in Beta. Account admins can manage access to this feature from the account console Previews page. See Manage account-level previews.
This page explains how to use the identity system tables to query the users, service principals, and groups in your Databricks account, how groups nest inside each other, and which entitlements each principal holds in each workspace. Use these tables to answer questions such as "who belongs to this group, including nested members?" or "who is a workspace admin?" with SQL, and join them with other system tables to resolve principal IDs to names and emails.
To query these tables, you need USE CATALOG on system, USE SCHEMA on system.access, and SELECT on each table.
Tables
Table | Description | Primary key |
|---|---|---|
| One row per principal: users, service principals, account groups, and workspace-local groups. |
|
| One row per transitive group membership. Includes every ancestor group, not only direct parents. |
|
| One row per principal per workspace, listing the entitlements the principal holds directly in that workspace. |
|
Each table contains the latest known state of each principal, membership, or assignment. Soft-deleted records remain in the tables with delete_time set. Records removed at the source drop out of the tables, so the tables don't provide a complete deletion history. To exclude soft-deleted records, filter on delete_time IS NULL.
Principals table schema
The principals_latest table includes all account-level users, service principals, and groups in your account, plus all workspace-local groups.
Column name | Data type | Description |
|---|---|---|
| string | ID of the Databricks account. |
| string | ID of the workspace. Set only for workspace-local groups. Null for account-level principals. |
| string | ID of the principal. |
| string | Type of the principal. One of |
| string | Display name of the principal. Can be null. |
| string | Status of the principal. One of |
| string | Username of the principal, typically an email address. Set when |
| string | Application ID of the service principal. Set when |
| struct | Identity provider metadata, set when the principal is managed by an external identity provider. Contains |
| timestamp | When the principal was added to the account. |
| timestamp | When the principal was last modified. |
| timestamp | When the principal was deleted from the account. Null while the principal exists. |
Parent groups table schema
The parent_groups_latest table contains the transitive closure of group membership. If user A belongs to group B, and group B belongs to group C, the table contains a row for A in B, a row for A in C, and a row for B in C.
Column name | Data type | Description |
|---|---|---|
| string | ID of the Databricks account the parent group belongs to. |
| string | ID of the workspace the parent group belongs to. Set only when the parent group is a workspace-local group. Null for account-level groups. |
| string | ID of the member principal. Join with |
| string | ID of the group the member belongs to. Join with |
| timestamp | When the membership was created. For a transitive membership, the earliest time any connecting path of memberships was fully established. |
| timestamp | When the membership was last modified. For a transitive membership, the most recent modification across the connecting memberships. |
| timestamp | When the membership was deleted. Null while the membership holds. For a transitive membership, set only after every connecting path has been deleted. |
Workspace entitlements table schema
The workspace_entitlements_latest table lists the entitlements each principal holds directly in each workspace. A principal appears only if it holds at least one direct entitlement and is assigned to the workspace, either directly or through (possibly nested) group membership. The table contains rows for workspaces in the same region as the metastore you query from.
Entitlements are direct only. Entitlements a principal inherits through its group memberships don't appear in its row. To find a principal's effective entitlements, join with parent_groups_latest and include the entitlements of every group the principal belongs to.
Column name | Data type | Description |
|---|---|---|
| string | ID of the Databricks account. |
| string | ID of the workspace. |
| string | ID of the principal assigned to the workspace. |
| array of string | Entitlements the principal holds directly in this workspace. Values: |
| timestamp | When both the direct entitlement record and the workspace assignment existed. |
| timestamp | Most recent modification across the entitlement and assignment records. |
| timestamp | When either the contributing entitlement records or every assignment path was deleted. Null otherwise. |
See Manage entitlements.
Sample queries
The following sections include sample SQL queries using the identity system tables.
- Who belongs to a group, including nested members?
- Which users are workspace admins?
- Which service principals are in my account?
Who belongs to a group, including nested members?
Because parent_groups_latest contains every transitive membership, this query returns direct and nested members in one step.
SELECT
pg.child_id AS member_id,
p.principal_type,
p.display_name,
p.email
FROM
system.access.parent_groups_latest AS pg
JOIN system.access.principals_latest AS p
ON pg.account_id = p.account_id
AND pg.child_id = p.principal_id
WHERE
pg.parent_id = '<group-id>'
AND pg.delete_time IS NULL
AND p.delete_time IS NULL;
Which users are workspace admins?
This query returns users who hold the WORKSPACE_ADMIN entitlement directly in a workspace. It doesn't include users who are admins through a group. To include them, join with parent_groups_latest.
SELECT
we.principal_id,
p.display_name,
p.email
FROM
system.access.workspace_entitlements_latest AS we
JOIN system.access.principals_latest AS p
ON we.account_id = p.account_id
AND we.principal_id = p.principal_id
WHERE
we.workspace_id = '<workspace-id>'
AND array_contains(we.entitlements, 'WORKSPACE_ADMIN')
AND we.delete_time IS NULL
AND p.delete_time IS NULL
AND p.principal_type = 'USER';
Which service principals are in my account?
This query returns the active service principals in your account and their application IDs.
SELECT
principal_id,
application_id,
display_name,
status,
create_time
FROM
system.access.principals_latest
WHERE
principal_type = 'SERVICE_PRINCIPAL'
AND delete_time IS NULL;
Limitations
- The tables refresh about every hour, so recent changes to users, groups, or entitlements might not appear immediately.
- The tables contain the latest state only, not a history of changes.
Additional resources
-
- System tables reference
- See the other system tables and how to enable and query them.
-
- Manage entitlements
- Learn what each workspace entitlement grants.