小编Chr*_*una的帖子

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

我有一个表有一个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表示的内容.

谢谢

ddl hadoop hive partitioning

6
推荐指数
1
解决办法
6483
查看次数

标签 统计

ddl ×1

hadoop ×1

hive ×1

partitioning ×1