【发布时间】:2017-11-14 19:19:22
【问题描述】:
我在hive中有一个非常复杂的表结构,假设如下表:
create table dirceu ( a struct<b:string,c:string>);
现在我确实需要在 a 列中添加另一个子列,它应该具有 b、c 和 d 结构,我正在尝试使用以下更改表:
alter table dirceu change column a a struct<b:string,c:string, d:string>;
但这会引发以下错误:
Error: 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 :
a (state=08S01,code=1)
有没有办法使用alter table 来做到这一点?我知道我可以使用创建表并复制数据来做到这一点,但我想知道是否有其他方法可以做到这一点。 更新 我正在使用蜂巢:2.1.0.2.6.1.0-129 HortonWorks:HDP-2.6.1.0
【问题讨论】: