vw_account_user_roles
Creates, updates, deletes, gets or lists a vw_account_user_roles resource.
Overview
| Name | vw_account_user_roles |
| Type | View |
| Id | databricks_account.iam.vw_account_user_roles |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID used to scope the query. |
id | string | Unique identifier for the account user. |
userName | string | Username (typically email address) of the account user. |
displayName | string | Human-readable display name of the account user. |
role | string | Role assigned to the user (one row per role assignment). |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID used to scope the query. |
SELECT Examples
SELECT
account_id,
id,
userName,
displayName,
role
FROM databricks_account.iam.vw_account_user_roles
WHERE account_id = '{{ account_id }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
u.account_id,
u.id,
u.userName,
u.displayName,
JSON_EXTRACT(r.value, '$.value') AS role
FROM databricks_account.iam.account_users u,
JSON_EACH(u.roles) r
WHERE account_id = '{{ account_id }}'
SELECT
u.account_id,
u.id,
u.userName,
u.displayName,
r.value->>'value' AS role
FROM databricks_account.iam.account_users u,
jsonb_array_elements(u.roles::jsonb) AS r
WHERE account_id = '{{ account_id }}'