I am trying to copy a directory in databricks from one location to another
dbutils.fs.cp("/path/to/directory", "new_path/to/directory")
Prior to running this I confirm the directory exists:
folders <- list.folders("/path/to/", full.names = TRUE)
print(folders)
I receive this error despite /path/to/directory being confirmed as existing:
java.io.FileNotFoundException: /path/to/directory
If you don't specify the schema, then it's assumed
dbfs:
, while you're trying to copy local file to DBFS. You need to specifyfile:
schema when working with local files:To copy local file to DBFS: