catalogs
Operations on a catalogs
resource.
Overview
Name | catalogs |
Type | Resource |
Id | databricks_workspace.unitycatalog.catalogs |
Fields
Name | Datatype |
---|---|
name | string |
browse_only | boolean |
catalog_type | string |
comment | string |
connection_name | string |
created_at | integer |
created_by | string |
effective_predictive_optimization_flag | object |
enable_predictive_optimization | string |
full_name | string |
isolation_mode | string |
metastore_id | string |
options | object |
owner | string |
properties | object |
provider_name | string |
provisioning_info | object |
securable_kind | string |
securable_type | string |
share_name | string |
storage_location | string |
storage_root | string |
updated_at | integer |
updated_by | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name, deployment_name | Gets the specified catalog in a metastore. The caller must be a metastore admin, the owner of the catalog, or a user that has the |
list | SELECT | deployment_name | Gets an array of catalogs in the metastore. If the caller is the metastore admin, all catalogs will be retrieved. Otherwise, only catalogs owned by the caller (or for which the caller has the |
create | INSERT | deployment_name | Creates a new catalog instance in the parent metastore if the caller is a metastore admin or has the |
delete | DELETE | name, deployment_name | Deletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog. |
update | UPDATE | name, deployment_name | Updates the catalog that matches the supplied name. The caller must be either the owner of the catalog, or a metastore admin (when changing the owner field of the catalog). |
SELECT
examples
- catalogs (list)
- catalogs (get)
SELECT
name,
browse_only,
catalog_type,
comment,
connection_name,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
full_name,
isolation_mode,
metastore_id,
options,
owner,
properties,
provider_name,
provisioning_info,
securable_kind,
securable_type,
share_name,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.catalogs
WHERE deployment_name = '{{ deployment_name }}';
SELECT
name,
browse_only,
catalog_type,
comment,
connection_name,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
full_name,
isolation_mode,
metastore_id,
options,
owner,
properties,
provider_name,
provisioning_info,
securable_kind,
securable_type,
share_name,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.catalogs
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new catalogs
resource.
- catalogs
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.catalogs (
deployment_name,
data__name,
data__comment,
data__properties,
data__storage_root,
data__provider_name,
data__share_name,
data__connection_name,
data__options
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ comment }}',
'{{ properties }}',
'{{ storage_root }}',
'{{ provider_name }}',
'{{ share_name }}',
'{{ connection_name }}',
'{{ options }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: comment
value: string
- name: properties
value:
property1: string
property2: string
- name: storage_root
value: string
- name: provider_name
value: string
- name: share_name
value: string
- name: connection_name
value: string
- name: options
value:
property1: string
property2: string
UPDATE
example
Updates a catalogs
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.catalogs
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a catalogs
resource.
/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.catalogs
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';