Skip to main content

directories

Operations on a directories resource.

Overview

Namedirectories
TypeResource
Iddatabricks_workspace.workspace.directories

Fields

NameDatatype
object_idinteger
object_typestring
pathstring

Methods

NameAccessible byRequired ParamsDescription
listSELECTpath, deployment_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

SELECT examples

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

INSERT example

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

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