FAQ-维度建模修改表调用 Hive报错 types incompatible

问题描述/异常栈

The following columns have types incompatible with the existing columns in their respective positions

发现版本

问题原因

hive对不安全的类型转换有限制,如 string 转成 int 等,如果要忽略这种限制,需要 
set hive.metastore.disallow.incompatible.col.type.changes=false

以下为官网完整清单

FAQ-维度建模修改表调用 Hive报错 types incompatible - 图1

解决方案

1. 不安全的类型转换,重建表
2. 自助分析通过hive 新增 set hive.metastore.disallow.incompatible.col.type.changes=false 参数后执行字段类型转换sql

作者:李凌威