dbfs_read | R Documentation |
Return the contents of a file. If the file does not exist, this call throws an exception with RESOURCE_DOES_NOT_EXIST.
dbfs_read(path, workspace, token = NULL, verbose = T, ...)
path |
Absolute path to a file on 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 |
The API endpoint for reading files from DBFS is '2.0/dbfs/read'. For all details on API calls please see the official documentation at https://docs.databricks.com/dev-tools/api/latest/.
The API response and the base6-encoded contents of the file read.
# No need to include /dbfs/ file_path <- "/tmp/iris.json" res <- dbfs_read(path = file_path, workspace = workspace) data <- res$data # Decode from base64 tidy_data <- jsonlite::fromJSON(rawToChar(jsonlite::base64_dec(data)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.