SPARK SQL: Implement AND condition inside a CASE statement
<p>I am aware of how to implement a simple CASE-WHEN-THEN clause in SPARK SQL using Scala. I am using Version 1.6.2. But, I need to specify AND condition on multiple columns inside the CASE-WHEN clause. How to achieve this in SPARK using Scala ?</p>

<p>Thanks in advance for your time and help!</p>

<p>Here's the SQL query that I have: </p>

<pre><code>select  sd.standardizationId,
   case when sd.numberOfShares = 0 and
             isnull(sd.derivatives,0) = 0 and 
             sd.holdingTypeId not in (3,10)
        then 
             8
        else
             holdingTypeId
       end 
   as holdingTypeId 
from sd;
</code></pre>