dbfs_files
Creates, updates, deletes, gets or lists a dbfs_files
resource.
Overview
Name | dbfs_files |
Type | Resource |
Id | databricks_workspace.filemanagement.dbfs_files |
Fields
The following fields are returned by SELECT
queries:
- read
Request completed successfully.
Name | Datatype | Description |
---|---|---|
bytes_read | integer | |
data | string |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
read | select | deployment_name | Returns the contents of a file. If the file does not exist, this call throws an exception with | |
move | exec | deployment_name | Moves a file from one location to another location within DBFS. If the source file does not exist, this call throws an exception with | |
put | exec | deployment_name | Uploads 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.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- read
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
- move
- put
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 }}"
}';
Uploads 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.
EXEC databricks_workspace.filemanagement.dbfs_files.put
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"path": "{{ path }}",
"contents": "{{ contents }}",
"overwrite": "{{ overwrite }}"
}';