I have written a Java Spark SQL UDF as below.
import org.apache.spark.sql.api.java.UDF1;
public class LowerCase_UDF implements UDF1<String,String>
{
@Override
public String call(String t1) throws Exception
{
String output="";
output=t1.toLowerCase();
return output;
}
}
What is the process to register this function in spark? If I run sqlContext.udf.register("LowerCaseUDF", call), it throws an exception "error: notfound: value call"
I have added the jar file generated to the spark-client/lib folder. But it does not seem to work. We want the function to be in Java for certain reasons. Any help on this will be appreciated. Thank you