Skip to main content

directories

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

Overview

Namedirectories
TypeResource
Iddatabricks_workspace.workspace.directories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
object_idinteger
object_typestring
pathstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_nameLists the contents of a directory, or the object if it is not a directory. If the input path does not exist, this call returns an error
mkdirsinsertdeployment_nameCreates the specified directory (and necessary parent directories if they do not exist). If there is an object (not a directory) at any prefix of the input path, this call returns an error

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

Lists the contents of a directory, or the object if it is not a directory. If the input path does not exist, this call returns an error

SELECT
object_id,
object_type,
path
FROM databricks_workspace.workspace.directories
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates the specified directory (and necessary parent directories if they do not exist). If there is an object (not a directory) at any prefix of the input path, this call returns an error

INSERT INTO databricks_workspace.workspace.directories (
data__path,
deployment_name
)
SELECT
'{{ path }}',
'{{ deployment_name }}'
;