metastores
Operations on a metastores
resource.
Overview
Name | metastores |
Type | Resource |
Id | databricks_workspace.unitycatalog.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 | id, deployment_name | Gets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info. |
list | SELECT | deployment_name | Gets an array of the available metastores (as |
create | INSERT | deployment_name | Creates a new metastore based on a provided name and optional storage root path. By default (if the |
delete | DELETE | id, deployment_name | Deletes a metastore. The caller must be a metastore admin. |
update | UPDATE | id, deployment_name | Updates information for a specific metastore. The caller must be a metastore admin. If the |
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_workspace.unitycatalog.metastores
WHERE deployment_name = '{{ deployment_name }}';
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 id = '{{ id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new metastores
resource.
- metastores
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.metastores (
deployment_name,
data__name,
data__storage_root,
data__region
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ storage_root }}',
'{{ region }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: storage_root
value: string
- name: region
value: string
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 }}';