Skip to main content

dbfs_streams

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

Overview

Namedbfs_streams
TypeResource
Iddatabricks_workspace.filemanagement.dbfs_streams

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
createinsertdeployment_nameOpens a stream to write to a file and returns a handle to this stream. There is a 10 minute idle timeout on this handle. If a file or directory already exists on the given path and
closedeletedeployment_nameCloses the stream specified by the input handle. If the handle does not exist, this call throws an exception with
addblockexecdeployment_nameAppends a block of data to the stream specified by the input handle. If the handle does not exist, this call will throw 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)

INSERT examples

Opens a stream to write to a file and returns a handle to this stream. There is a 10 minute idle timeout on this handle. If a file or directory already exists on the given path and

INSERT INTO databricks_workspace.filemanagement.dbfs_streams (
data__path,
data__overwrite,
deployment_name
)
SELECT
'{{ path }}',
'{{ overwrite }}',
'{{ deployment_name }}'
RETURNING
handle
;

DELETE examples

Closes the stream specified by the input handle. If the handle does not exist, this call throws an exception with

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

Lifecycle Methods

Appends a block of data to the stream specified by the input handle. If the handle does not exist, this call will throw an exception with

EXEC databricks_workspace.filemanagement.dbfs_streams.addblock 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"handle": "{{ handle }}",
"data": {{ data }}
}';