自定义函数UDF1之坑

public class SumStringUdf implements UDF1 {
@Override
public Double call(String sumStr) throws Exception {
// 处理规则
}
}
【自定义函数UDF1之坑】写法上不会报错,但是一旦执行,就会报错: of the type (java.lang.Double) cannot be converted to the string type
所以需要改成
public class SumStringUdf implements UDF1 {
@Override
public String call(String sumStr) throws Exception {
// 处理规则
}
}

    推荐阅读