SHOW ROLES

Queries all role information in the current workspace or instance.

Workspace Roles

Syntax

SHOW ROLES [LIKE 'pattern'];

Parameter Description

ParameterRequiredDescription
LIKE 'pattern'NoFilters by role name. Supports SQL wildcards % (matches any string) and _ (matches a single character). Case-insensitive

Return Column Description

Column NameDescription
nameRole name
commentRole description

Usage Examples

  1. Query all roles in the current workspace:

    SHOW ROLES;

    Example output:

    namecomment
    system_adminsystem role
    test_developer_roleTest role
    test_readonly_roleRead-only role for testing
    workspace_adminSystem preset role with management permissions for tasks, environments, and all data objects in the workspace, as well as permissions for managing members and roles in the workspace.
    workspace_analystSystem preset role with development feature usage permissions and all compute cluster usage permissions.
    workspace_devSystem preset role with management permissions for task directories in the workspace, editing permissions for task scripts, and read and write permissions for all data objects in the workspace.
    workspace_sreSystem preset role with management permissions for all tasks and jobs in the workspace.
    workspace_userSystem preset role with read-only permissions for the workspace environment, metadata read permissions for all data objects, and read-only permissions for roles and members in the workspace.
  2. Query roles whose names contain admin:

    SHOW ROLES LIKE '%admin%';

    Example output:

    namecomment
    system_adminsystem role
    workspace_adminSystem preset role with management permissions for tasks, environments, and all data objects in the workspace, as well as permissions for managing members and roles in the workspace.
  3. Exact match for a role name:

    SHOW ROLES LIKE 'workspace_dev';

Notes

  • Executing this command requires permission to query role information (workspace_user and above roles have this by default).
  • System preset roles (workspace_admin, workspace_dev, workspace_analyst, workspace_sre, workspace_user) cannot be dropped but can be granted to users.
  • LIKE filtering is case-insensitive.

Instance Roles

Syntax

SHOW INSTANCE ROLES [LIKE 'pattern'];

Parameter Description

ParameterRequiredDescription
LIKE 'pattern'NoFilters by role name; rules are the same as for Workspace roles

Return Column Description

Column NameDescription
nameInstance role name
commentRole description

Usage Examples

  1. Query all roles in the current instance:

    SHOW INSTANCE ROLES;

    Example output:

    namecomment
    instance_adminSystem preset role for managing the creation and deletion of all workspaces in the instance, and for managing the granting of instance-level roles.
    instance_datamap_adminSystem preset role with management permissions for functions and objects in data assets.
    instance_datamap_userSystem preset role with read-only permissions for data assets.
    instance_datasource_adminSystem preset role with management permissions for data sources.
    instance_sensitivedata_viewerSystem preset role with permission to view sensitive data.
    instance_sreSystem preset role with management permissions for all tasks and jobs across all workspaces.
    instance_userSystem preset role initially assigned to service instance members; has no data or functional permissions.
  2. Query instance roles whose names contain admin:

    SHOW INSTANCE ROLES LIKE '%admin%';

Notes

  • Instance roles apply to the entire instance scope, with permissions higher than workspace roles. Grant them with caution.
  • Executing this command requires instance-level role query permission.