Skip to main content

dbfs_directories

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

Overview

Namedbfs_directories
TypeResource
Iddatabricks_workspace.filemanagement.dbfs_directories

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
file_sizeinteger
is_dirboolean
modification_timeinteger
pathstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_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

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

List the contents of a directory, or details of the file. If the file or directory does not exist, this call throws an exception with

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

INSERT examples

Creates 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

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