Reputation: 408
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;
col1 date col2 string col3 string abc decimal(11,2)
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 ?
Upvotes: 2
Views: 1840
Reputation: 44991
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
;
Upvotes: 1