title: Apache Spark UDF working fine on spark-shell but failing in jar
body: <p>I have written one UDF which accepts two arrays of maps. It finds the Map which is not present in the other Map and adds it with new Map return new(Array) + missing Map from old Map.</p>
  <p>It works fine in spark-shell but throws NPE when I submit it through a jar.</p>
  <pre><code>val getr= udf((incr :scala.collection.mutable.WrappedArray[Map[String, String]], lookup : scala.collection.mutable.WrappedArray[Map[String, String]]) =&gt; {
      val latest: scala.collection.mutable.Seq[scala.collection.mutable.Map[String,String]]= incr.asInstanceOf[scala.collection.mutable.WrappedArray[scala.collection.mutable.Map[String,String]]]
      val old= lookup.filter(item=&gt;incr.indexOf(item) == -1)
      latest ++ old
  
    })
  
  </code></pre>
  <p>Immediate help will be appreciated.</p>