title: Handling null values in Dataframe
body: <p>I have a DataFrame as below.</p>
  
  <pre><code>Value1 Value2 Value3
  30000  40000  50000
  null   20000  10000
  </code></pre>
  
  <p>Also, I have a UDF created as</p>
  
  <pre><code>val testUDF=udf((a: Double, b: Double, c: Double) =&gt; {
     if(a==null &amp;&amp; b!=null &amp;&amp; c!=null)
         b+c
     else
         a+b+c
  })
  </code></pre>
  
  <p>I have a code as below.</p>
  
  <pre><code>input.withColumn("checkNull", testUDF(col("value1"),col("value2"),col("value3"))).show
  </code></pre>
  
  <p>Resulting dataframe is as</p>
  
  <pre><code>Value1 Value2 Value3 checkNull
  30000  40000  50000  120000
  null   20000  10000   null
  </code></pre>
  
  <p>Here, instead of displaying 3000 for second row for the column "checkNUll", it displayed, null. Any thing I am doing wrong in my code?
  I dont want to replace it with 0. Because, if I want to do multiplication instead of addition above, it will fail.</p>