cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error with spark-sftp, no such file

andreas9898
New Contributor II

In a databricks cluster with Scala 2.1.1 I am trying to read a file into a spark data frame using the following code.

val df = spark.read
  .format("com.springml.spark.sftp")
  .option("host", "*")
  .option("username", "*")
  .option("password", "*")
  .option("fileType", "csv")
  .option("delimiter", ";")
  .option("inferSchema", "true")
  .load("/my_file.csv")

However, I get the following error

org.apache.spark.sql.AnalysisException: Path does not exist: dbfs:/local_disk0/tmp/my_file.csv;

I think I need to load the file from a temporary locationbut, I can't find that path and a way to do so. Can anyone help with that?

3 REPLIES 3

Debayan
Esteemed Contributor III
Esteemed Contributor III

Hi @Andreas P​ , could you please run the below command and see if you can list the file?

import os
os.listdir('/dbfs/tmp')

Please refer: https://docs.databricks.com/files/index.html#access-files-on-the-driver-filesystem

Hubert-Dudek
Esteemed Contributor III

What distribution is that? I remember that it hasn't worked on the community edition in the past due to a lack of access to the underlying system. Also, there can be differences between single/standard clusters and high concurrency/shared ones.

Anonymous
Not applicable

Hi @Andreas P​ 

Hope all is well!

Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.