本文主要是介绍Flinksql bug :Illegal mixing of types in CASE or COALESCE statement,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错信息
org.apache.flink.table.api.ValidationException: SQL validation failed. From line 66, column 23 to line 68, column 46: Illegal mixing of types in CASE or COALESCE statement
org.apache.calcite.runtime.CalciteContextException: From line 66, column 23 to line 68, column 46: Illegal mixing of types in CASE or COALESCE statement
org.apache.calcite.sql.validate.SqlValidatorException: Illegal mixing of types in CASE or COALESCE statement
发生地址
flinksql中的 COALESCE 函数 或 case 函数
报错原因:
case when 多条判断语句 输出数据类型不一致
实例 :
case when id = 1 then 1
when id = 2 then '2'
end
解决方案:
统一数据类型即可
case when id = 1 then 1
when id = 2 then case('2' as int )
end
这篇关于Flinksql bug :Illegal mixing of types in CASE or COALESCE statement的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!