Skip to main content

metastores

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

Overview

Namemetastores
TypeResource
Iddatabricks_workspace.unitycatalog.metastores

Fields

The following fields are returned by SELECT queries:

The metastore was successfully retrieved.

NameDatatypeDescription
namestring
default_data_access_config_idstring
global_metastore_idstring
metastore_idstring
storage_root_credential_idstring
delta_sharing_organization_namestring
storage_root_credential_namestring
cloudstring
created_atinteger
created_bystring
delta_sharing_recipient_token_lifetime_in_secondsinteger
delta_sharing_scopestring
external_access_enabledboolean
ownerstring
privilege_model_versionstring
regionstring
storage_rootstring
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info.
listselectdeployment_nameGets an array of the available metastores (as
createinsertdeployment_nameCreates a new metastore based on a provided name and optional storage root path. By default (if the
updateupdatedeployment_nameUpdates information for a specific metastore. The caller must be a metastore admin. If the
deletedeletedeployment_nameDeletes a metastore. The caller must be a metastore admin.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Gets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info.

SELECT
name,
default_data_access_config_id,
global_metastore_id,
metastore_id,
storage_root_credential_id,
delta_sharing_organization_name,
storage_root_credential_name,
cloud,
created_at,
created_by,
delta_sharing_recipient_token_lifetime_in_seconds,
delta_sharing_scope,
external_access_enabled,
owner,
privilege_model_version,
region,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.metastores
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new metastore based on a provided name and optional storage root path. By default (if the

INSERT INTO databricks_workspace.unitycatalog.metastores (
data__name,
data__storage_root,
data__region,
deployment_name
)
SELECT
'{{ name }}',
'{{ storage_root }}',
'{{ region }}',
'{{ deployment_name }}'
RETURNING
name,
default_data_access_config_id,
global_metastore_id,
metastore_id,
storage_root_credential_id,
delta_sharing_organization_name,
storage_root_credential_name,
cloud,
created_at,
created_by,
delta_sharing_recipient_token_lifetime_in_seconds,
delta_sharing_scope,
external_access_enabled,
owner,
privilege_model_version,
region,
storage_root,
updated_at,
updated_by
;

UPDATE examples

Updates information for a specific metastore. The caller must be a metastore admin. If the

UPDATE databricks_workspace.unitycatalog.metastores
SET
data__storage_root_credential_id = '{{ storage_root_credential_id }}',
data__delta_sharing_recipient_token_lifetime_in_seconds = {{ delta_sharing_recipient_token_lifetime_in_seconds }},
data__delta_sharing_organization_name = '{{ delta_sharing_organization_name }}',
data__owner = '{{ owner }}',
data__privilege_model_version = '{{ privilege_model_version }}',
data__new_name = '{{ new_name }}',
data__delta_sharing_scope = '{{ delta_sharing_scope }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
default_data_access_config_id,
global_metastore_id,
metastore_id,
storage_root_credential_id,
delta_sharing_organization_name,
storage_root_credential_name,
cloud,
created_at,
created_by,
delta_sharing_recipient_token_lifetime_in_seconds,
delta_sharing_scope,
external_access_enabled,
owner,
privilege_model_version,
region,
storage_root,
updated_at,
updated_by;

DELETE examples

Deletes a metastore. The caller must be a metastore admin.

DELETE FROM databricks_workspace.unitycatalog.metastores
WHERE deployment_name = '{{ deployment_name }}' --required;