title: SPARK : Max number of executor failures (3) reached
body: <p>I am getting above error when calling function in Spark SQL. I have written function in different scala file and calling in another scala file.</p>
  
  <p>Ex: Function.Scala</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>object Utils extends Serializable {
    
    
    def Formater (d:String):java.sql.Date =
    {
      
      
      val df=new SimpleDateFormat("yyyy-MM-dd")
      val newFormat=df.format(d)
      val dat= java.sql.Date.valueOf(newFormat)
      
      return dat 
      
      
    }
    
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am calling above function in another scala file.</p>
  
  <p>Registered UDF here :</p>
  
  <p>sqlContext.udf.register("Formater",(s:String) => Utils.Formater(s))</p>
  
  <p>and using here :- </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>val startdate =sqlContext.sql("select  dateFormater(parameterValue) from Table").show()</code></pre>
  </div>
  </div>
  </p>
  
  <p>If I remove the above function the code is running without any issue, If I include it is throwing me the above error.</p>