Skip to main content

dbfs_files

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

Overview

Namedbfs_files
TypeResource
Iddatabricks_workspace.filemanagement.dbfs_files

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
bytes_readinteger
datastring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
readselectdeployment_nameReturns the contents of a file. If the file does not exist, this call throws an exception with
moveexecdeployment_nameMoves a file from one location to another location within DBFS. If the source file does not exist, this call throws an exception with
putexecdeployment_nameUploads a file through the use of multipart form post. It is mainly used for streaming uploads, but can also be used as a convenient single call for data upload.

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

Returns the contents of a file. If the file does not exist, this call throws an exception with

SELECT
bytes_read,
data
FROM databricks_workspace.filemanagement.dbfs_files
WHERE deployment_name = '{{ deployment_name }}' -- required;

Lifecycle Methods

Moves a file from one location to another location within DBFS. If the source file does not exist, this call throws an exception with

EXEC databricks_workspace.filemanagement.dbfs_files.move 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"source_path": "{{ source_path }}",
"destination_path": "{{ destination_path }}"
}';