Skip to main content

metastores

Operations on a metastores resource.

Overview

Namemetastores
TypeResource
Iddatabricks_workspace.unitycatalog.metastores

Fields

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

Methods

NameAccessible byRequired ParamsDescription
getSELECTid, deployment_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
deleteDELETEid, deployment_nameDeletes a metastore. The caller must be a metastore admin.
updateUPDATEid, deployment_nameUpdates information for a specific metastore. The caller must be a metastore admin. If the

SELECT examples

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

INSERT example

Use the following StackQL query and manifest file to create a new metastores resource.

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.metastores (
deployment_name,
data__name,
data__storage_root,
data__region
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ storage_root }}',
'{{ region }}'
;

UPDATE example

Updates a metastores resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.metastores
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a metastores resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.metastores
WHERE id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';