【问题标题】:Trying to change the cloumn type in hive, running a DDL, but it's throwing an error "尝试更改 hive 中的列类型,运行 DDL,但抛出错误“
【发布时间】:2017-01-13 15:45:41
【问题描述】:

尝试更改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.

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

【问题讨论】:

    标签: hadoop hive ddl hive-serde


    【解决方案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处理的存储类型不支持此操作。

    【讨论】:

      猜你喜欢
      • 2021-12-12
      • 2018-06-19
      • 1970-01-01
      • 2011-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-13
      • 2023-03-14
      相关资源
      最近更新 更多