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:ย 

When Try Returns Success for Invalid S3 Path in Spark: Is This a Bug?

allinux
New Contributor II

Try(spark.read.format("parquet").load("s3://abcd/abcd/")) should result in Failure, but when executed in the notebook, it returns Success as shown below. Isn't this a bug?

Try[DataFrame] = Success(...)

2 REPLIES 2

MuthuLakshmi
Databricks Employee
Databricks Employee

@allinux The read is a valid way to load data. Why are you expecting a failure? can you please explain? 

When running in spark shell, a Failure is received as shown below. I wonder why it behaves differently.

scala> Try(spark.read.format("parquet").load("/abcd/abcd/"))
res1: scala.util.Try[org.apache.spark.sql.DataFrame] = Failure(org.apache.spark.sql.AnalysisException: [PATH_NOT_FOUND] Path does not exist: file:/abcd/abcd.)

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