【发布时间】:2015-07-17 12:54:47
【问题描述】:
我有一个表,它有一个 int 类型的分区,但我想将其转换为字符串。但是,我不知道该怎么做。
表格说明为:
Col1 timestamp
Col2 string
Col3 string
Col4 string
Part_col int
# Partition information
# col_name data_type comment
Part_col int
我创建的分区是 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;
我也尝试过使用“partition (Part_col)”一次更改所有分区。
我收到错误“列引用 Part_col 无效”
我正在使用来自https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types 的示例来转换十进制列,但无法弄清楚 dec_column_name 代表什么。
谢谢
【问题讨论】:
标签: hadoop hive partitioning ddl