2
votes

I have a empty partitioned table in Hive and i am trying to name of a column along with the order of columns in the table :

    > describe formatted test_hive;

col_name data_type comment

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

Partition Information

col_name data_type comment

mth_year string

Trying to rename abc to xyz and moving it after col1 , but when i run

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

but getting error :

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

Can we do alter on empty partition table ?

1

1 Answers

1
votes

You have to note the specific partition, e.g. -

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

or doing it in the table level -

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