external_locations
Operations on a external_locations
resource.
Overview
Name | external_locations |
Type | Resource |
Id | databricks_workspace.unitycatalog.external_locations |
Fields
Name | Datatype |
---|---|
name | string |
access_point | string |
browse_only | boolean |
comment | string |
created_at | integer |
created_by | string |
credential_id | string |
credential_name | string |
isolation_mode | string |
metastore_id | string |
owner | string |
read_only | boolean |
updated_at | integer |
updated_by | string |
url | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name, deployment_name | Gets an external location from the metastore. The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location. |
list | SELECT | deployment_name | Gets an array of external locations ( |
create | INSERT | deployment_name | Creates a new external location entry in the metastore. The caller must be a metastore admin or have the |
delete | DELETE | name, deployment_name | Deletes the specified external location from the metastore. The caller must be the owner of the external location. |
update | UPDATE | name, deployment_name | Updates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin. In the second case, the admin can only update the name of the external location. |
SELECT
examples
- external_locations (list)
- external_locations (get)
SELECT
name,
access_point,
browse_only,
comment,
created_at,
created_by,
credential_id,
credential_name,
isolation_mode,
metastore_id,
owner,
read_only,
updated_at,
updated_by,
url
FROM databricks_workspace.unitycatalog.external_locations
WHERE deployment_name = '{{ deployment_name }}';
SELECT
name,
access_point,
browse_only,
comment,
created_at,
created_by,
credential_id,
credential_name,
isolation_mode,
metastore_id,
owner,
read_only,
updated_at,
updated_by,
url
FROM databricks_workspace.unitycatalog.external_locations
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new external_locations
resource.
- external_locations
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.external_locations (
deployment_name,
data__name,
data__url,
data__credential_name,
data__read_only,
data__comment,
data__access_point,
data__skip_validation
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ url }}',
'{{ credential_name }}',
'{{ read_only }}',
'{{ comment }}',
'{{ access_point }}',
'{{ skip_validation }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: url
value: string
- name: credential_name
value: string
- name: read_only
value: true
- name: comment
value: string
- name: access_point
value: string
- name: skip_validation
value: true
UPDATE
example
Updates a external_locations
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.external_locations
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a external_locations
resource.
/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.external_locations
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';