Skip to main content

catalogs

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

Overview

Namecatalogs
TypeResource
Iddatabricks_workspace.catalog.catalogs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of catalog.
metastore_idstringUnique identifier of parent metastore.
connection_namestringThe name of the connection to an external data source.
full_namestringThe full name of the catalog. Corresponds with the name field.
provider_namestringThe name of delta sharing provider. A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
share_namestringThe name of the share under the share provider.
browse_onlyboolean
catalog_typestringThe type of the catalog. (DELTASHARING_CATALOG, FOREIGN_CATALOG, INTERNAL_CATALOG, MANAGED_CATALOG, MANAGED_ONLINE_CATALOG, SYSTEM_CATALOG)
commentstringUser-provided free-form text description.
created_atintegerTime at which this catalog was created, in epoch milliseconds.
created_bystringUsername of catalog creator.
effective_predictive_optimization_flagobject
enable_predictive_optimizationstringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access::<br /><br />&gt;&gt;&gt; Color.RED<br />&lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br />&gt;&gt;&gt; Color(1)<br />&lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br />&gt;&gt;&gt; Color['RED']<br />&lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (DISABLE, ENABLE, INHERIT)
isolation_modestringWhether the current securable is accessible from all workspaces or a specific set of workspaces. (ISOLATED, OPEN)
optionsobjectA map of key-value properties attached to the securable.
ownerstringUsername of current owner of catalog.
propertiesobjectA map of key-value properties attached to the securable.
provisioning_infoobjectStatus of an asynchronously provisioned resource.
securable_typestringThe type of Unity Catalog securable. (CATALOG, CLEAN_ROOM, CONNECTION, CREDENTIAL, EXTERNAL_LOCATION, EXTERNAL_METADATA, FUNCTION, METASTORE, PIPELINE, PROVIDER, RECIPIENT, SCHEMA, SHARE, STAGING_TABLE, STORAGE_CREDENTIAL, TABLE, VOLUME)
storage_locationstringStorage Location URL (full path) for managed tables within catalog.
storage_rootstringStorage root URL for managed tables within catalog.
updated_atintegerTime at which this catalog was last modified, in epoch milliseconds.
updated_bystringUsername of user who last modified catalog.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameinclude_browseGets the specified catalog in a metastore. The caller must be a metastore admin, the owner of the
listselectdeployment_nameinclude_browse, include_unbound, max_results, page_tokenGets an array of catalogs in the metastore. If the caller is the metastore admin, all catalogs will be
createinsertdeployment_name, nameCreates a new catalog instance in the parent metastore if the caller is a metastore admin or has the
updateupdatename, deployment_nameUpdates the catalog that matches the supplied name. The caller must be either the owner of the
deletedeletename, deployment_nameforceDeletes the catalog that matches the supplied name. The caller must be a metastore admin or the owner

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)
namestringThe name of the catalog.
forcebooleanForce deletion even if the catalog is not empty.
include_browsebooleanWhether to include catalogs in the response for which the principal can only access selective metadata for
include_unboundbooleanWhether to include catalogs not bound to the workspace. Effective only if the user has permission to update the catalog–workspace binding.
max_resultsintegerMaximum number of catalogs to return. - when set to 0, the page length is set to a server configured value (recommended); - when set to a value greater than 0, the page length is the minimum of this value and a server configured value; - when set to a value less than 0, an invalid parameter error is returned; - If not set, all valid catalogs are returned (not recommended). - Note: The number of returned catalogs might be less than the specified max_results size, even zero. The only definitive indication that no further catalogs can be fetched is when the next_page_token is unset from the response.
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Gets the specified catalog in a metastore. The caller must be a metastore admin, the owner of 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_type,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.catalog.catalogs
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_browse = '{{ include_browse }}'
;

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.catalog.catalogs (
name,
comment,
connection_name,
options,
properties,
provider_name,
share_name,
storage_root,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ comment }}',
'{{ connection_name }}',
'{{ options }}',
'{{ properties }}',
'{{ provider_name }}',
'{{ share_name }}',
'{{ storage_root }}',
'{{ 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_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

UPDATE databricks_workspace.catalog.catalogs
SET
comment = '{{ comment }}',
enable_predictive_optimization = '{{ enable_predictive_optimization }}',
isolation_mode = '{{ isolation_mode }}',
new_name = '{{ new_name }}',
options = '{{ options }}',
owner = '{{ owner }}',
properties = '{{ properties }}'
WHERE
name = '{{ name }}' --required
AND 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_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

DELETE FROM databricks_workspace.catalog.catalogs
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND force = '{{ force }}'
;