cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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
Databricks Employee
Databricks Employee

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!

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now