Incompatible return types 'DECIMAL(38,7)' of exprs
更新时间: 2024-03-11 02:43:17
阅读 1476
Incompatible return types 'DECIMAL(38,7)' of exprs xxx
问题描述/异常栈
org.apache.impala.common.AnalysisException: Incompatible return types 'DECIMAL(38,7)' and 'DECIMAL(37,4)' of exprs 't1.year_pdemand_qty_mtd / 10000' and 'round(t1.year_avg_wgt_mtd / t1.year_pdemand_qty_mtd, 4)'.
解决方案
统一精度:
case
when t1.target_number='a' then round(t1.rolling_fresh_wgt_mtd/1000,4)
when t1.target_number='b' then round(t1.rolling_pdemand_qty_mtd/10000,4)
when t1.target_number='c' then round(t1.rolling_avg_wgt_mtd/t1.rolling_pdemand_qty_mtd,4)
else round(t11.rolling_value,4)
问题原因
下列条件中精度不一致
作者:林帅
文档反馈
以上内容对您是否有帮助?