METASTORES

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

INFORMATION_SCHEMA.METASTORES describes the current metastore.

Information is displayed only for the current metastore for all users.

This is an extension to the SQL Standard Information Schema.

Definition

The METASTORES relation contains the following columns:

Name Data type Nullable Description
METASTORE_ID STRING No ID of the metastore.
METASTORE_NAME STRING No Name of the metastore.
METASTORE_OWNER STRING No Owner of the metastore.
STORAGE_ROOT STRING No Storage root URL of the metastore.
STORAGE_ROOT_CREDENTIAL_ID STRING Yes ID of the storage credential to access storage root.
STORAGE_ROOT_CREDENTIAL_NAME STRING Yes Name of the storage credential to access storage root.
DELTA_SHARING_SCOPE STRING No Delta Sharing scope for the metastore.
DELTA_SHARING_RECIPIENT_TOKEN_LIFETIME LONG Yes The lifetime of Delta Sharing recipient tokens in seconds.
DELTA_SHARING_ORGANIZATION_NAME STRING No The organization name of a Delta Sharing entity. The name will be used in Databricks-to-Databricks Delta Sharing as the official name.
PRIVILEGE_MODEL_VERSION STRING No Privilege model version.
CLOUD STRING No Cloud vendor of the metastore.
REGION STRING No Dataplane region that the metastore serves.
GLOBAL_METASTORE_ID STRING No Globally unique metastore ID across clouds and regions. Used as Delta Sharing sharing identifier.
CREATED TIMESTAMP No Timestamp when the metastore was created.
CREATED_BY STRING No Principal who created the metastore.
LAST_ALTERED TIMESTAMP No Timestamp when the metastore was last altered in any way.
LAST_ALTERED_BY STRING No Principal who last altered the metastore.

Constraints

The following constraints apply to the METASTORES relation:

Class Name Column List Description
Primary key METASTORES_PK METASTORE_ID, METASTORE_NAME Unique identifier for the metastore.
Foreign key METASTORES_CREDS_FK STORAGE_ROOT_CREDENTIAL_ID, STORAGE_ROOT_CREDENTIAL_NAME References STORAGE_CREDENTIALS

Examples

> SELECT metastore_owner
    FROM information_schema.metastores