flink Unsupported operand types: IF(boolean, NULL, String)

问题:业务方存储了NULL 字符串,需要处理为 null

sql 复制代码
select if('a'='null',null,'a');

结果遇到了 Unsupported operand types: IF(boolean, NULL, String),根据报错反馈,很明显应该是没有对 null 自动转换(Spark 是会自动转的)

源码:

if 的源码我以前看过,就是calcyte自动生成的,在org.apache.flink.table.planner.codegen.calls 的 IfCallGen 类

确实没办法了,只能

sql 复制代码
select if(a='null',cast(null as string),'a')
相关推荐
大飞哥~BigFei36 分钟前
RabbitMq消费延迟衰减重试实现思路
java·分布式·rabbitmq
有趣的野鸭42 分钟前
JAVA课程十一次实验课程主要知识点示例
java·前端·数据库
q***07143 小时前
Spring Boot 多数据源解决方案:dynamic-datasource-spring-boot-starter 的奥秘(上)
java·spring boot·后端
q***49863 小时前
Spring Boot 3.4 正式发布,结构化日志!
java·spring boot·后端
沐浴露z5 小时前
【微服务】基本概念介绍
java·微服务
Z3r4y6 小时前
【代码审计】RuoYi-4.7.3&4.7.8 定时任务RCE 漏洞分析
java·web安全·ruoyi·代码审计
Kuo-Teng7 小时前
LeetCode 160: Intersection of Two Linked Lists
java·算法·leetcode·职场和发展
Jooou7 小时前
Spring事务实现原理深度解析:从源码到架构全面剖析
java·spring·架构·事务
盖世英雄酱581368 小时前
commit 成功为什么数据只更新了部分?
java·数据库·后端