question

JeffvG-0844 avatar image
2 Votes"
JeffvG-0844 asked TomasHudik-8748 commented

How do I download a file from Azure's DBFS?

I'd like to get a copy of df.csv downloaded to my local system. How would I do that?

117481-image.png


azure-databricks
image.png (40.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

VaibhavChaudhari avatar image
3 Votes"
VaibhavChaudhari answered TomasHudik-8748 commented

Modify the URL slightly, press enter and you get the file downloaded to your local.

Files stored in /FileStore are accessible in your web browser at https://<databricks-instance>/files/.

For example, the file you stored in /FileStore/my-stuff/my-file.txt is accessible at https://<databricks-instance>/files/my-stuff/my-file.txt.

However, if there is ?o= in the deployment URL, for example,
https://<databricks-instance>/?o=6280049833xxxxxx, replace
https://<databricks-instance>/files/my-stuff/my-file.txt with
https://<databricks-instance>/files/my-stuff/my-file.txt?o=###### where the number after o= is the same as in your URL.

E.g.
https://adb-xxx.x.azuredatabricks.net/files/df.csv?o=xxx

Reference:
https://docs.databricks.com/data/filestore.html#save-a-file-to-filestore
https://stackoverflow.com/questions/66685638/databricks-download-a-dbfs-filestore-file-to-my-local-machine


Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

doesnt work for me :(
I tried:
https://adb-5389.9.azuredatabricks.net/files/df/my_strange_data.csv/part-00000-tid-1033926715138875070-f24dc9a2-6aca-4138-b028-f4543392a3c1-5302-1-c000.csv?o=538662387150889
and got:



HTTP ERROR: 404

Problem accessing files/df/my_strange_data.csv/part-00000-tid-1033926715138875070-f24dc9a2-6aca-4138-b028-f4543392a3c1-5302-1-c000.csv. Reason:

 Bad Target: GET files/df/my_strange_data.csv/part-00000-tid-1033926715138875070-f24dc9a2-6aca-4138-b028-f4543392a3c1-5302-1-c000.csv


There is no simple way how to get 2KB file from Databricks? Crazy, I've spent already 3 hours on this :(

0 Votes 0 ·