hivealter语句

vlju58qv  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(242)

我在配置单元中有一个空的分区表,我正在尝试指定列的名称以及表中列的顺序:

> describe formatted test_hive;

列名称数据类型注解

col1 date col2 string col3 string decimal(11,2)

分区信息

列名称数据类型注解

mth\ U年字符串
尝试将重命名为xyz并将其移到col1之后,但是当我运行

alter table test_hive partition(mth_year)  CHANGE abc  xyz DECIMAL(11,2) AFTER col1;

但是得到错误:

FAILED: SemanticException [Error 10006]: Partition not found {proc_mth_year=null}

我们能改变空分区表吗?

jdzmm42g

jdzmm42g1#

你必须注意具体的分区,例如-

alter table test_hive partition (mth_year='03_2017') 
change abc xyz decimal(11,2) after col1
;

或者在table上做-

alter table test_hive
change abc xyz decimal(11,2) after col1
cascade
;

相关问题