<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pattern Matching not working as expected with 10.4 LTS databricks runtime version in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pattern-matching-not-working-as-expected-with-10-4-lts/m-p/19368#M12969</link>
    <description>&lt;P&gt;Hi everyone, &lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically doing this and returning Left or Right: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val result = spark.sql(sqlQuery)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(result.count &amp;gt; 0) Left(result) else Right(true)&lt;/P&gt;&lt;P&gt;this will return Right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then:&lt;/P&gt;&lt;P&gt;match {&lt;/P&gt;&lt;P&gt;&amp;nbsp;case Right(true) =&amp;gt;&amp;nbsp;println("Right")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case _ =&amp;gt;   println("Other")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;but here instead running case Right it goes into case _ always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am not sure what I am doing wrong here. If you can help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 11:54:20 GMT</pubDate>
    <dc:creator>179019</dc:creator>
    <dc:date>2022-05-27T11:54:20Z</dc:date>
    <item>
      <title>Pattern Matching not working as expected with 10.4 LTS databricks runtime version</title>
      <link>https://community.databricks.com/t5/data-engineering/pattern-matching-not-working-as-expected-with-10-4-lts/m-p/19368#M12969</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically doing this and returning Left or Right: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val result = spark.sql(sqlQuery)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(result.count &amp;gt; 0) Left(result) else Right(true)&lt;/P&gt;&lt;P&gt;this will return Right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then:&lt;/P&gt;&lt;P&gt;match {&lt;/P&gt;&lt;P&gt;&amp;nbsp;case Right(true) =&amp;gt;&amp;nbsp;println("Right")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case _ =&amp;gt;   println("Other")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;but here instead running case Right it goes into case _ always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am not sure what I am doing wrong here. If you can help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 11:54:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pattern-matching-not-working-as-expected-with-10-4-lts/m-p/19368#M12969</guid>
      <dc:creator>179019</dc:creator>
      <dc:date>2022-05-27T11:54:20Z</dc:date>
    </item>
  </channel>
</rss>

