dbfs_mv: Move a file or directory on DBFS

View source: R/dbfs_mv.R

dbfs_mvR Documentation

Move a file or directory on DBFS

Description

Move a file from one location to another location *within* DBFS. This will not move files from your local system to DBFS. See 'dbfs_put()' and 'dbfs_read()' to work with your local filesystem.

Usage

dbfs_mv(from, to, workspace, token = NULL, verbose = T, ...)

Arguments

from

A string representing the source path in DBFS

to

A string representing the destination path in DBFS

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

If the source file does not exist, this call throws an exception with RESOURCE_DOES_NOT_EXIST. If there already exists a file in the destination path, this call throws an exception with RESOURCE_ALREADY_EXISTS. If the given source path is a directory, this call always recursively moves all files.

The API endpoint for moving files or directories on DBFS is '2.0/dbfs/move'. 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/
source_path <- "/data/my_model.rds"
destination_path <- "/models/my_model.rds"

dbfs_mv(from = source_path, to = destination_path, workspace = workspace)

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