dbfs_rm: Delete a file or directory on DBFS

View source: R/dbfs_rm.R

dbfs_rmR Documentation

Delete a file or directory on DBFS

Description

Delete the file or directory (optionally recursively delete all files in the directory). This call throws an exception with IO_ERROR if the path is a non-empty directory and recursive is set to false or on other similar errors. When you delete a large number of files, the delete operation is done in increments. The call returns a response after approximately 45s with an error message (503 Service Unavailable) asking you to re-invoke the delete operation until the directory structure is fully deleted.

Usage

dbfs_rm(path, recursive = "false", workspace, token = NULL, verbose = T, ...)

Arguments

path

A string representing the path to delete in DBFS

recursive

Should the deletes be recursive or not? Defaults to 'false'

workspace

A string representing the web workspace of your Databricks instance. E.g., "https://eastus2.azuredatabricks.net" or "https://demo.cloud.databricks.com".

token

A valid authentication token generated via User Settings in Databricks or via the Databricks REST API 2.0. If none is provided, netrc will be used

verbose

If TRUE, will print the API response to the console. Defaults to FALSE.

...

Additional options to be passed

Details

The API endpoint for creating a path on DBFS is '2.0/dbfs/delete'. For all details on API calls please see the official documentation at https://docs.databricks.com/dev-tools/api/latest/.

Value

The API response

Examples

# No need to include /dbfs/
path <- "/rk/data/new_dir"

dbfs_rm(path = path, workspace = workspace)

RafiKurlansik/bricksteR documentation built on Oct. 13, 2022, 6:58 a.m.