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.)

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