试图改变hive中的cloumn类型,运行DDL,但它会抛出错误"

时间:2017-01-13 15:45:42

标签: hadoop hive ddl hive-serde

尝试在hive中更改cloumn类型,运行DDL,但是它会抛出错误

运行以下DDL:

ALTER TABLE INV.HTL_RATE_PLAN
CHANGE RATE_PLAN_RSTRCT_STRT_DT RATE_PLAN_RSTRCT_STRT_DT DATE 
COMMENT 'Advance booking alternate days restriction rule applied to a rate category. This rule dictates the minimum number of days before arrival the guest must book for the rate category to be available.'
AFTER PRICE_GRID_CD;

错误:

Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Reordering columns is not supported for table INV_TRF.HTL_RATE_PLAN. SerDe may be incompatible.

帮助?我究竟做错了什么。请建议。

1 个答案:

答案 0 :(得分:1)

要更改列类型,您只需要这样:

ALTER TABLE INV.HTL_RATE_PLAN
CHANGE RATE_PLAN_RSTRCT_STRT_DT RATE_PLAN_RSTRCT_STRT_DT DATE 
COMMENT 'Advance booking alternate days restriction rule applied to a rate category. This rule dictates the minimum number of days before arrival the guest must book for the rate category to be available.';

删除的部分AFTER PRICE_GRID_CD将列位置更改为指定列之后,但是由serde处理的存储类型不支持此操作。