将列添加到Hive外部表错误

时间:2016-12-01 20:17:06

标签: hadoop apache-spark hive bigdata

尝试在HIVE中将列添加到外部表但是得到以下错误。这个表目前有一千个分区注册,我想“避免重新创建表,然后运行MSCK REPAIR,这需要很长时间才能完成。此外,该表使用OpenCSVSerde格式。如何添加列

    hive> ALTER TABLE schema.Table123 ADD COLUMNS (Column1000 STRING);

    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. java.lang.IllegalArgumentException: Error: type expected at the position 0 of '<derived from deserializer>' but '<' is found.

1 个答案:

答案 0 :(得分:-2)

试试这个:

Use your_database_name;

然后:

ALTER TABLE Table123 ADD COLUMNS (Column1000 STRING);