Skip to main content

vw_user_groups

Creates, updates, deletes, gets or lists a vw_user_groups resource.

Overview

Namevw_user_groups
TypeView
Iddatabricks_workspace.iam.vw_user_groups

Fields

The following fields are returned by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.
idstringUnique identifier for the workspace user.
userNamestringUsername of the workspace user.
displayNamestringHuman-readable display name of the workspace user.
group_idstringUnique identifier of the group the user belongs to (one row per group membership).
group_namestringDisplay name of the group.
group_refstringSCIM $ref URI for the group resource.
group_typestringType of the group resource (typically Group).

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
deployment_namestringWorkspace deployment name used to scope the query.

SELECT Examples

SELECT
deployment_name,
id,
userName,
displayName,
group_id,
group_name,
group_ref,
group_type
FROM databricks_workspace.iam.vw_user_groups
WHERE deployment_name = '{{ deployment_name }}';

SQL Definition

SELECT
u.deployment_name,
u.id,
u.userName,
u.displayName,
JSON_EXTRACT(g.value, '$.value') AS group_id,
JSON_EXTRACT(g.value, '$.display') AS group_name,
JSON_EXTRACT(g.value, '$.$ref') AS group_ref,
JSON_EXTRACT(g.value, '$.type') AS group_type
FROM databricks_workspace.iam.users_v2 u,
JSON_EACH(u.groups) g
WHERE u.deployment_name = '{{ deployment_name }}'