hadoop - Hive 1.1.0 Alter table partition type from int to string -


i have table has partition of type int want convert string. however, can't figure out how this.

the table description is:

col1 timestamp col2 string col3 string col4 string part_col int  # partition information # col_name data_type comment  part_col int 

the partitions have created part_col=0, part_col=1, ..., part_col=23

i want change them part_col='0' etc

i run command in hive:

set hive.exec.dynamic.partitions = true; alter table tbl_name partition (part_col=0) part_col part_col string; 

i have tried using "partition (part_col)" change partitions @ once.

i error "invalid column reference part_col"

i using example https://cwiki.apache.org/confluence/display/hive/languagemanual+types conversion of decimal columns can't figure out dec_column_name represents.

thanks

a bit of digging revealed there hive jira have command updating partition column data type (https://issues.apache.org/jira/browse/hive-3672)

alter table {table_name} partition column ({column_name} {column_type}); 

according jira command implemented, it's apparent never documented on hive wiki.

i used on hive 0.14 system , worked expected.


Comments