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: 

Pattern Matching not working as expected with 10.4 LTS databricks runtime version

179019
New Contributor

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

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