Skip to main content

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:

NameData typeNullableDescription
METASTORE_IDSTRINGNoID of the metastore.
METASTORE_NAMESTRINGNoName of the metastore.
METASTORE_OWNERSTRINGNoOwner of the metastore.
STORAGE_ROOTSTRINGNoStorage root URL of the metastore.
STORAGE_ROOT_CREDENTIAL_IDSTRINGYesID of the storage credential to access storage root.
STORAGE_ROOT_CREDENTIAL_NAMESTRINGYesName of the storage credential to access storage root.
DELTA_SHARING_SCOPESTRINGNoDelta Sharing scope for the metastore.
DELTA_SHARING_RECIPIENT_TOKEN_LIFETIMELONGYesThe lifetime of Delta Sharing recipient tokens in seconds.
DELTA_SHARING_ORGANIZATION_NAMESTRINGNoThe organization name of a Delta Sharing entity. The name will be used in Databricks-to-Databricks Delta Sharing as the official name.
PRIVILEGE_MODEL_VERSIONSTRINGNoPrivilege model version.
CLOUDSTRINGNoCloud vendor of the metastore.
REGIONSTRINGNoDataplane region that the metastore serves.
GLOBAL_METASTORE_IDSTRINGNoGlobally unique metastore ID across clouds and regions. Used as Delta Sharing sharing identifier.
CREATEDTIMESTAMPNoTimestamp when the metastore was created.
CREATED_BYSTRINGNoPrincipal who created the metastore.
LAST_ALTEREDTIMESTAMPNoTimestamp when the metastore was last altered in any way.
LAST_ALTERED_BYSTRINGNoPrincipal who last altered the metastore.

Constraints

The following constraints apply to the METASTORES relation:

ClassNameColumn ListDescription
Primary keyMETASTORES_PKMETASTORE_ID, METASTORE_NAMEUnique identifier for the metastore.
Foreign keyMETASTORES_CREDS_FKSTORAGE_ROOT_CREDENTIAL_ID, STORAGE_ROOT_CREDENTIAL_NAMEReferences STORAGE_CREDENTIALS

Examples

SQL
> SELECT metastore_owner
FROM information_schema.metastores