Skip to main content

dbfs_directories

Operations on a dbfs_directories resource.

Overview

Namedbfs_directories
TypeResource
Iddatabricks_workspace.filemanagement.dbfs_directories

Fields

NameDatatype
file_sizeinteger
is_dirboolean
modification_timeinteger
pathstring

Methods

NameAccessible byRequired ParamsDescription
listSELECTpath, deployment_nameList the contents of a directory, or details of the file. If the file or directory does not exist, this call throws an exception with
mkdirsINSERTdeployment_nameCreates the given directory and necessary parent directories if they do not exist. If a file (not a directory) exists at any prefix of the input path, this call throws an exception with

SELECT examples

SELECT
file_size,
is_dir,
modification_time,
path
FROM databricks_workspace.filemanagement.dbfs_directories
WHERE path = '{{ path }}' AND
deployment_name = '{{ deployment_name }}';

INSERT example

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

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