Skip to main content

external_locations

Operations on a external_locations resource.

Overview

Nameexternal_locations
TypeResource
Iddatabricks_workspace.unitycatalog.external_locations

Fields

NameDatatype
namestring
access_pointstring
browse_onlyboolean
commentstring
created_atinteger
created_bystring
credential_idstring
credential_namestring
isolation_modestring
metastore_idstring
ownerstring
read_onlyboolean
updated_atinteger
updated_bystring
urlstring

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, deployment_nameGets 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.
listSELECTdeployment_nameGets an array of external locations (
createINSERTdeployment_nameCreates a new external location entry in the metastore. The caller must be a metastore admin or have the
deleteDELETEname, deployment_nameDeletes the specified external location from the metastore. The caller must be the owner of the external location.
updateUPDATEname, deployment_nameUpdates 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

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

INSERT example

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

/*+ 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 }}'
;

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