Skip to main content

shares

Operations on a shares resource.

Overview

Nameshares
TypeResource
Iddatabricks_workspace.deltasharing.shares

Fields

NameDatatype
namestring
commentstring
created_atinteger
created_bystring
objectsarray
ownerstring
storage_locationstring
storage_rootstring
updated_atinteger
updated_bystring

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, deployment_nameGets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.
listSELECTdeployment_nameGets an array of data object shares from the metastore. The caller must be a metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.
createINSERTdeployment_nameCreates a new share for data objects. Data objects can be added after creation with
deleteDELETEname, deployment_nameDeletes a data object share from the metastore. The caller must be an owner of the share.
updateUPDATEname, deployment_nameUpdates the share with the changes and data objects in the request. The caller must be the owner of the share or a metastore admin.

SELECT examples

SELECT
name,
comment,
created_at,
created_by,
objects,
owner,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.deltasharing.shares
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.deltasharing.shares (
deployment_name,
data__name,
data__comment,
data__storage_root
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ comment }}',
'{{ storage_root }}'
;

UPDATE example

Updates a shares resource.

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

DELETE example

Deletes a shares resource.

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