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