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