metastores
Operations on a metastores
resource.
Overview
Name | metastores |
Type | Resource |
Id | databricks_account.unity_catalog.metastores |
Fields
Name | Datatype |
---|---|
name | string |
cloud | string |
created_at | integer |
created_by | string |
default_data_access_config_id | string |
delta_sharing_organization_name | string |
delta_sharing_recipient_token_lifetime_in_seconds | integer |
delta_sharing_scope | string |
external_access_enabled | boolean |
global_metastore_id | string |
metastore_id | string |
owner | string |
privilege_model_version | string |
region | string |
storage_root | string |
storage_root_credential_id | string |
storage_root_credential_name | string |
updated_at | integer |
updated_by | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | account_id, metastore_id | Gets a Unity Catalog metastore from an account, both specified by ID. |
list | SELECT | account_id | Gets all Unity Catalog metastores associated with an account specified by ID. |
create | INSERT | account_id | Creates a Unity Catalog metastore. |
delete | DELETE | account_id, metastore_id | Deletes a Unity Catalog metastore for an account, both specified by ID. |
update | REPLACE | account_id, metastore_id | Updates an existing Unity Catalog metastore. |
SELECT
examples
- metastores (list)
- metastores (get)
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 }}';
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 }}' AND
metastore_id = '{{ metastore_id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new metastores
resource.
- metastores
- Manifest
/*+ create */
INSERT INTO databricks_account.unity_catalog.metastores (
account_id,
data__metastore_info
)
SELECT
'{{ account_id }}',
'{{ metastore_info }}'
;
- name: your_resource_model_name
props:
- name: metastore_info
value:
name: string
storage_root: string
region: string
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 }}';