Skip to main content

dbfs_objects

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

Overview

Namedbfs_objects
TypeResource
Iddatabricks_workspace.filemanagement.dbfs_objects

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
getstatusselectdeployment_nameGets the file information for a file or directory. If the file or directory does not exist, this call throws an exception with
deletedeletedeployment_nameDelete the file or directory (optionally recursively delete all files in the directory). 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

Gets the file information for a file or directory. 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_objects
WHERE deployment_name = '{{ deployment_name }}' -- required;

DELETE examples

Delete the file or directory (optionally recursively delete all files in the directory). This call throws an exception with

DELETE FROM databricks_workspace.filemanagement.dbfs_objects
WHERE deployment_name = '{{ deployment_name }}' --required;