Pattern Matching not working as expected with 10.4 LTS databricks runtime version
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 04:54 AM
Hi everyone,
I recently upgraded the runtime version of one of the databricks job to 10.4 LTS but Pattern Matching is not working as expected the same code is working in 7.3 LTS.
Basically doing this and returning Left or Right:
val result = spark.sql(sqlQuery)
if(result.count > 0) Left(result) else Right(true)
this will return Right
then:
match {
case Right(true) => println("Right")
case _ => println("Other")
}
but here instead running case Right it goes into case _ always.
So I am not sure what I am doing wrong here. If you can help me with this.
Thanks
0 REPLIES 0

