更新时间:2022-09-30 GMT+08:00
分享

Hive同步数据报错SQLException

问题

Hive同步数据时报错:

Caused by: java.sql.SQLException: Error while processing statement: 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 :
__col1,__col2

回答

这种情况通常会发生当您试图使用HiveSyncTool.java类向现有hive表添加新列时。数据库通常不允许将列数据类型按照从高到低的顺序修改,或者数据类型可能与表中已存储/将要存储的数据冲突。若要修复相同的问题,请尝试设置以下属性:

设置hive.metastore.disallow.in compatible.col.type.changes为false。

分享:

    相关文档

    相关产品