我在Hive中有一个空的分区表,我正在尝试命名一个列以及表中列的顺序:
> describe formatted test_hive;col_name data_type注释
col1 date col2 string col3 string abc decimal(11,2)
分区信息
col_name data_type注释
mth_year字符串
尝试将abc重命名为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}我们可以在空的分区表上执行alter吗?
发布于 2017-03-14 23:51:09
你必须注明具体的分区,例如-
alter table test_hive partition (mth_year='03_2017')
change abc xyz decimal(11,2) after col1
;或者是在表级上做-
alter table test_hive
change abc xyz decimal(11,2) after col1
cascade
;https://stackoverflow.com/questions/42789644
复制相似问题