练习1:继承UDF,然后重写evaluate方法,hello world的测试
public class helloudf extends UDF {
public String evaluate(String str){
try {
return "Hello " + str;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return "ERROR";
}
}
public static void main(String[] args) {
helloudf helloudf = new helloudf();
String ycc = helloudf.evaluate("ycc");
System.out.println(ycc);
}
}