Fluxy
Fluxy

Reputation: 2978

How to download a file from Databricks filesystem without using CLI?

I saved a file from Databricks notebook as follows:

joblib.dump(rf, '/dbfs/FileStore/model.pkl', compress=9)

How can I download it to my local filesystem without using CLI?

I tried as follows:

https://westeurope.azuredatabricks.net/dbfs/FileStore/model.pkl?o=####

But it does not work.

Upvotes: 0

Views: 4255

Answers (2)

harishkashyap
harishkashyap

Reputation: 114

Easiest is that you start to write to s3 bucket as

df.write.format("com.databricks.spark.csv").option("header", "true") \
  .save("s3://<your folder desired(exist or not)/file")

Now you can retrieve it with aws s3 cp <your folder desired(exist or not)/file <local file path>

Upvotes: 0

Fluxy
Fluxy

Reputation: 2978

I figured it out myself:

https://westeurope.azuredatabricks.net/files/model.pkl?o=####

More details can be found here.

Upvotes: 0

Related Questions