shares
Operations on a shares
resource.
Overview
Name | shares |
Type | Resource |
Id | databricks_workspace.deltasharing.shares |
Fields
Name | Datatype |
---|---|
name | string |
comment | string |
created_at | integer |
created_by | string |
objects | array |
owner | string |
storage_location | string |
storage_root | string |
updated_at | integer |
updated_by | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name, deployment_name | Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share. |
list | SELECT | deployment_name | Gets 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. |
create | INSERT | deployment_name | Creates a new share for data objects. Data objects can be added after creation with |
delete | DELETE | name, deployment_name | Deletes a data object share from the metastore. The caller must be an owner of the share. |
update | UPDATE | name, deployment_name | 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. |
SELECT
examples
- shares (list)
- shares (get)
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 }}';
SELECT
name,
comment,
created_at,
created_by,
objects,
owner,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.deltasharing.shares
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new shares
resource.
- shares
- Manifest
/*+ create */
INSERT INTO databricks_workspace.deltasharing.shares (
deployment_name,
data__name,
data__comment,
data__storage_root
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ comment }}',
'{{ storage_root }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: comment
value: string
- name: storage_root
value: string
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 }}';