Skip to main content

volumes

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

Overview

Namevolumes
TypeResource
Iddatabricks_workspace.unitycatalog.volumes

Fields

The following fields are returned by SELECT queries:

Successfully retrieved the properties of the volume

NameDatatypeDescription
namestring
metastore_idstring
volume_idstring
catalog_namestring
full_namestring
schema_namestring
commentstring
created_atinteger
created_bystring
ownerstring
storage_locationstring
updated_atinteger
updated_bystring
volume_typestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
readselectdeployment_nameGets a volume from the metastore for a specific catalog and schema.
listselectdeployment_nameGets an array of volumes for the current metastore under the parent catalog and schema.
createinsertdeployment_nameCreates a new volume.
updateupdatedeployment_nameUpdates the specified volume under the specified parent catalog and schema.
deletedeletedeployment_nameDeletes a volume from the specified parent catalog and schema.

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 a volume from the metastore for a specific catalog and schema.

SELECT
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by,
volume_type
FROM databricks_workspace.unitycatalog.volumes
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new volume.

INSERT INTO databricks_workspace.unitycatalog.volumes (
data__catalog_name,
data__schema_name,
data__name,
data__volume_type,
data__storage_location,
data__comment,
deployment_name
)
SELECT
'{{ catalog_name }}',
'{{ schema_name }}',
'{{ name }}',
'{{ volume_type }}',
'{{ storage_location }}',
'{{ comment }}',
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by,
volume_type
;

UPDATE examples

Updates the specified volume under the specified parent catalog and schema.

UPDATE databricks_workspace.unitycatalog.volumes
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__new_name = '{{ new_name }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
metastore_id,
volume_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by,
volume_type;

DELETE examples

Deletes a volume from the specified parent catalog and schema.

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