hive修改列类型报错FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unabl

hive在修改列类型会报错,
原因是列中已存储的数据类型与转换的目标数据类型不兼容
错误代码:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 
Unable to alter table. The following columns have types incompatible with 
the existing columns in their respective positions :

举个例子:
比如现在A列的类型是String,里面存放的内容是字符串,那么它就不可以转换为int类型。
hive修改列类型报错FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unabl_第1张图片
所以如果现在A列的类型是String,存放的内容是数字,那么它就可以在int类型与String类型之间来回转换。

hive修改列类型报错FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unabl_第2张图片

你可能感兴趣的:(hive,大数据,hadoop)