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!

Connect with Databricks Users in Your Area

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