Skip to main content

catalogs

Creates, updates, deletes, gets or lists a catalogs resource.

Overview

Namecatalogs
TypeResource
Iddatabricks_workspace.unitycatalog.catalogs

Fields

The following fields are returned by SELECT queries:

The catalog was successfully retrieved.

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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_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
updateupdatedeployment_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).
deletedeletedeployment_nameDeletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

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

SELECT
name,
metastore_id,
connection_name,
full_name,
provider_name,
share_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
isolation_mode,
options,
owner,
properties,
provisioning_info,
securable_kind,
securable_type,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.catalogs
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new catalog instance in the parent metastore if the caller is a metastore admin or has the

INSERT INTO databricks_workspace.unitycatalog.catalogs (
data__name,
data__comment,
data__storage_root,
data__provider_name,
data__share_name,
data__connection_name,
data__properties,
data__options,
deployment_name
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ storage_root }}',
'{{ provider_name }}',
'{{ share_name }}',
'{{ connection_name }}',
'{{ properties }}',
'{{ options }}',
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
connection_name,
full_name,
provider_name,
share_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
isolation_mode,
options,
owner,
properties,
provisioning_info,
securable_kind,
securable_type,
storage_location,
storage_root,
updated_at,
updated_by
;

UPDATE examples

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).

UPDATE databricks_workspace.unitycatalog.catalogs
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__isolation_mode = '{{ isolation_mode }}',
data__enable_predictive_optimization = '{{ enable_predictive_optimization }}',
data__new_name = '{{ new_name }}',
data__properties = '{{ properties }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
metastore_id,
connection_name,
full_name,
provider_name,
share_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
isolation_mode,
options,
owner,
properties,
provisioning_info,
securable_kind,
securable_type,
storage_location,
storage_root,
updated_at,
updated_by;

DELETE examples

Deletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.

DELETE FROM databricks_workspace.unitycatalog.catalogs
WHERE deployment_name = '{{ deployment_name }}' --required;