自定义函数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 {
// 处理规则
}
}
推荐阅读
- 一起来学习C语言的字符串转换函数
- C语言字符函数中的isalnum()和iscntrl()你都知道吗
- SpringBoot调用公共模块的自定义注解失效的解决
- C语言浮点函数中的modf和fmod详解
- python自定义封装带颜色的logging模块
- C语言中的时间函数clock()和time()你都了解吗
- 列出所有自定义的function和view
- 概率论/统计学|随机变量 的 分布函数 与 概率密度函数 的区别
- vue组件中为何data必须是一个函数()
- Spring|Spring Boot 自动配置的原理、核心注解以及利用自动配置实现了自定义 Starter 组件