Skip to main content

shares

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

Overview

Nameshares
TypeResource
Iddatabricks_workspace.deltasharing.shares

Fields

The following fields are returned by SELECT queries:

The share was successfully retrieved.

NameDatatypeDescription
namestring
commentstring
created_atinteger
created_bystring
objectsarray
ownerstring
storage_locationstring
storage_rootstring
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_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
updateupdatedeployment_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.
deletedeletedeployment_nameDeletes a data object share from the metastore. The caller must be an owner of the share.

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 data object share from the metastore. The caller must be a metastore admin or the owner of the share.

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 }}' -- required;

INSERT examples

Creates a new share for data objects. Data objects can be added after creation with

INSERT INTO databricks_workspace.deltasharing.shares (
data__name,
data__comment,
data__storage_root,
deployment_name
)
SELECT
'{{ name }}',
'{{ comment }}',
'{{ storage_root }}',
'{{ deployment_name }}'
RETURNING
name,
comment,
created_at,
created_by,
objects,
owner,
storage_location,
storage_root,
updated_at,
updated_by
;

UPDATE examples

Updates the share with the changes and data objects in the request. The caller must be the owner of the share or a metastore admin.

UPDATE databricks_workspace.deltasharing.shares
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__storage_root = '{{ storage_root }}',
data__new_name = '{{ new_name }}',
data__updates = '{{ updates }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
comment,
created_at,
created_by,
objects,
owner,
storage_location,
storage_root,
updated_at,
updated_by;

DELETE examples

Deletes a data object share from the metastore. The caller must be an owner of the share.

DELETE FROM databricks_workspace.deltasharing.shares
WHERE deployment_name = '{{ deployment_name }}' --required;