Skip to main content

vw_users

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

Overview

Namevw_users
TypeView
Iddatabricks_workspace.iam.vw_users

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 (typically email address) of the workspace user.
displayNamestringHuman-readable display name of the workspace user.
activebooleanWhether the user account is active.
externalIdstringExternal identity provider ID for the user (SCIM provisioned users only).
givenNamestringFirst (given) name of the user.
familyNamestringLast (family) name of the user.
emailstringEmail address for this entry (one row per email address).
email_typestringType classification of the email address (e.g. work).
is_primarybooleanWhether this email address is the user's primary email.

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,
active,
externalId,
givenName,
familyName,
email,
email_type,
is_primary
FROM databricks_workspace.iam.vw_users
WHERE deployment_name = '{{ deployment_name }}';

SQL Definition

SELECT
u.deployment_name,
u.id,
u.userName,
u.displayName,
u.active,
u.externalId,
JSON_EXTRACT(u.name, '$.givenName') AS givenName,
JSON_EXTRACT(u.name, '$.familyName') AS familyName,
JSON_EXTRACT(e.value, '$.value') AS email,
JSON_EXTRACT(e.value, '$.type') AS email_type,
JSON_EXTRACT(e.value, '$.primary') AS is_primary
FROM databricks_workspace.iam.users_v2 u,
JSON_EACH(u.emails) e
WHERE u.deployment_name = '{{ deployment_name }}'