title: Spark UDF error no TypeTag available for string
body: <p>I am trying to creating a User defined function but when I compile using Eclipse and Maven I get error <strong><em>No TypeTag available for String
  spark.udf.register("checkBlankorNulls_udf", checkBlankorNulls(_:String,_:String):String)</em></strong></p>
  
  <p>Running this code in spark-shell does not produce any errors. But building a JAR throws an error.</p>
  
  <pre><code>val spark = SparkSession.builder().appName("raw").config("spark.sql.warehouse.dir","C:\\tmp\spark-warehouse").getOrCreate()   
  
  import spark.implicits._ 
     // user defined function to check null or blank values
      def checkBlankorNulls(colName:String, colValue:String):String = {     
             if (colValue== null|| colValue=="null" || colValue ==" ")   
             {
               throw new Exception(colName.concat(" field is null or empty. Partitioned fields cannot be null"))
             }
             else {
               colValue                          
             }                        
      }  
  spark.udf.register("checkBlankorNulls_udf", checkBlankorNulls(_:String,_:String):String)
  </code></pre>