Skip to main content

catalogs

Operations on a catalogs resource.

Overview

Namecatalogs
TypeResource
Iddatabricks_workspace.unitycatalog.catalogs

Fields

NameDatatype
namestring
browse_onlyboolean
catalog_typestring
commentstring
connection_namestring
created_atinteger
created_bystring
effective_predictive_optimization_flagobject
enable_predictive_optimizationstring
full_namestring
isolation_modestring
metastore_idstring
optionsobject
ownerstring
propertiesobject
provider_namestring
provisioning_infoobject
securable_kindstring
securable_typestring
share_namestring
storage_locationstring
storage_rootstring
updated_atinteger
updated_bystring

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, deployment_nameGets the specified catalog in a metastore. The caller must be a metastore admin, the owner of the catalog, or a user that has the
listSELECTdeployment_nameGets 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
createINSERTdeployment_nameCreates a new catalog instance in the parent metastore if the caller is a metastore admin or has the
deleteDELETEname, deployment_nameDeletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.
updateUPDATEname, deployment_nameUpdates 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

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 }}';

INSERT example

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

/*+ 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 }}'
;

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 }}';