Hive 1.1.0将表分区类型从int更改为string

Chr*_*una 6 ddl hadoop hive partitioning

我有一个表有一个int类型的分区,但我想转换为字符串.但是,我无法弄清楚如何做到这一点.

表格描述如下:

Col1 timestamp
Col2 string
Col3 string
Col4 string
Part_col int

# Partition information
# col_name data_type comment

Part_col int
Run Code Online (Sandbox Code Playgroud)

我创建的分区是Part_col = 0,Part_col = 1,...,Part_col = 23

我想将它们更改为Part_col ='0'等

我在hive中运行此命令:

set hive.exec.dynamic.partitions = true;
Alter table tbl_name partition (Part_col=0) Part_col Part_col string;
Run Code Online (Sandbox Code Playgroud)

我也尝试使用"partition(Part_col)"一次更改所有分区.

我收到错误"无效的列引用Part_col"

我使用https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types中的示例来转换十进制列,但无法确定dec_column_name表示的内容.

谢谢

sok*_*aty 14

一点挖掘显示,有一个配置单元JIRA具有完全更新分区列数据类型的命令(https://issues.apache.org/jira/browse/HIVE-3672)

alter table {table_name} partition column ({column_name} {column_type});
Run Code Online (Sandbox Code Playgroud)

根据JIRA的说法,该命令已经实施,但很明显它从未在Hive Wiki上记录过.

我在我的Hive 0.14系统上使用它,它按预期工作.