Skip to main content

metastores

Operations on a metastores resource.

Overview

Namemetastores
TypeResource
Iddatabricks_account.unity_catalog.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
getSELECTaccount_id, metastore_idGets a Unity Catalog metastore from an account, both specified by ID.
listSELECTaccount_idGets all Unity Catalog metastores associated with an account specified by ID.
createINSERTaccount_idCreates a Unity Catalog metastore.
deleteDELETEaccount_id, metastore_idDeletes a Unity Catalog metastore for an account, both specified by ID.
updateREPLACEaccount_id, metastore_idUpdates an existing Unity Catalog metastore.

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_account.unity_catalog.metastores
WHERE account_id = '{{ account_id }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_account.unity_catalog.metastores (
account_id,
data__metastore_info
)
SELECT
'{{ account_id }}',
'{{ metastore_info }}'
;

REPLACE example

Replaces a metastores resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.unity_catalog.metastores
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
metastore_id = '{{ metastore_id }}';

DELETE example

Deletes a metastores resource.

/*+ delete */
DELETE FROM databricks_account.unity_catalog.metastores
WHERE account_id = '{{ account_id }}' AND
metastore_id = '{{ metastore_id }}';