Skip to main content

volumes

Operations on a volumes resource.

Overview

Namevolumes
TypeResource
Iddatabricks_workspace.unitycatalog.volumes

Fields

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

Methods

NameAccessible byRequired ParamsDescription
listSELECTcatalog_name, schema_name, deployment_nameGets an array of volumes for the current metastore under the parent catalog and schema.
readSELECTname, deployment_nameGets a volume from the metastore for a specific catalog and schema.
createINSERTdeployment_nameCreates a new volume.
deleteDELETEname, deployment_nameDeletes a volume from the specified parent catalog and schema.
updateUPDATEname, deployment_nameUpdates the specified volume under the specified parent catalog and schema.

SELECT examples

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

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.volumes (
deployment_name,
data__catalog_name,
data__schema_name,
data__name,
data__volume_type,
data__storage_location,
data__comment
)
SELECT
'{{ deployment_name }}',
'{{ catalog_name }}',
'{{ schema_name }}',
'{{ name }}',
'{{ volume_type }}',
'{{ storage_location }}',
'{{ comment }}'
;

UPDATE example

Updates a volumes resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.volumes
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a volumes resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.volumes
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';