12-06-2021 09:29 AM
When you use:
from pyspark import SparkFiles
spark.sparkContext.addFile(url)
it adds file to NON dbfs /local_disk0/ but then when you want to read file:
spark.read.json(SparkFiles.get("file_name"))
it wants to read it from /dbfs/local_disk0/. I tried also with file:// and many other creative ways and it doesn't work.
Of course it is working after using %sh cp - moving from /local_disk0/ to /dbfs/local_disk0/ .
It seems to be a bug like addFile was switched to dbfs on azure databricks but SparkFiles not (in original spark it addFile and gets to/from workers).
I couldn't find also any settings to manually specify RootDirectory for SparkFiles.
03-14-2022 08:20 AM
@Hubert Dudek
Have to tried with file:/// ?
I remember starting Spark 3.2, it honors the native hadoop file system if no file access protocol is defined.
12-13-2021 05:46 AM
Hello.
I'm in the same situation. Data extraction via API using sparkfiles in Community Databricks runs without error, however in Azure it generates the mentioned error.
12-13-2021 11:50 AM
In Azure it generates the mentioned error too
12-13-2021 11:53 AM
@Kaniz Fatma @Piper Wilson can you help to escalate that issue, as more people are complaining about that
12-13-2021 12:07 PM
Hello everyone
This problem to be happening with me too, in Azure. If somebody to can help us
12-13-2021 01:43 PM
@Hubert Dudek - You got it!
12-14-2021 03:59 AM
Hi, I'm new here and I have some doubts. Will the bug fix be attended to only if there are votes, comments and views?
12-14-2021 04:52 AM
someone should get back to us
12-14-2021 11:34 AM
@Kaniz Fatma (Databricks) @Piper (Customer)
Hi how are you?
Does this problem have a solution option?
12-14-2021 12:05 PM
@Prabakar Ammeappin @Werner Stinckens @Jose Gonzalez maybe you could look as well to that issue 🙂
12-14-2021 12:59 PM
@Hubert Dudek, @Dev John, @Marcos Gois, @Jorge Fernandes, and @welder martins - Are you able to open a support ticket here - https://help.databricks.com/s/contact-us?
12-14-2021 02:15 PM
ok, pity it can't be solved around here. But the ticket was opened, I give news of the progress.
thanks.
12-15-2021 10:54 AM
@welder martins - Thank you for opening the ticket. We want to cover all our bases.
12-28-2021 02:53 AM
Yes this solution was already discussed on stackoverflow. Problem is that this spark functionality should be adjusted in DBR to handle everything automatically via dbfs. Problem is that it seems that it was partly adjusted but not fully.
01-24-2022 03:49 AM
Hello everyone, any news?
Thanks.
@Kaniz Fatma
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group