METASTORE_PRIVILEGES

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 10.4 LTS and above

INFORMATION_SCHEMA.METASTORE_PRIVILEGES lists principals that have privileges on the current metastore.

This is an extension to the SQL Standard Information Schema.

Definition

The METASTORE_PRIVILEGES relation contains the following columns:

Name

Data type

Nullable

Description

GRANTOR

STRING

No

Principal that granted the privilege.

GRANTEE

STRING

No

Principal to which the privilege is granted.

METASTORE_ID

STRING

No

Metastore on which the privilege is granted.

PRIVILEGE_TYPE

STRING

No

Privilege being granted.

IS_GRANTABLE

STRING

No

Always NO. Reserved for future use.

INHERITED_FROM

STRING

No

The ancestor relation that the privilege is inherited from.

Constraints

The following constraints apply to the METASTORE_PRIVILEGES relation:

Class

Name

Column List

Description

Primary key

METPRIVS_PK

GRANTOR, GRANTEE, METASTORE_ID, PRIVILEGE_TYPE

Unique identifier for the granted privilege.

Foreign key

METPRIVS_METS_FK

METASTORE_ID

References METASTORES

Examples

> SELECT metastore_id, grantee
    FROM information_schema.metastore_privileges;