Hive 1.1.0. Change the type of table section from int to string.

I have a table that has a section of type int, but which I want to convert to a string. However, I cannot figure out how to do this.

Description of the table:

Col1 timestamp
Col2 string
Col3 string
Col4 string
Part_col int

# Partition information
# col_name data_type comment

Part_col int

The sections I created are Part_col = 0, Part_col = 1, ..., Part_col = 23

I want to change them to Part_col = '0', etc.

I run this command in the hive:

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

I also tried using "partition (Part_col)" to change all partitions simultaneously.

I get the error "Invalid column reference Part_col"

I am using an example from https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types to convert decimal columns, but cannot figure out what dec_column_name represents.

thank

+4
2

, JIRA, (https://issues.apache.org/jira/browse/HIVE-3672)

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

JIRA, , , Hive Wiki.

Hive 0.14 , .

+9

, yo , , .

:

  • ( ). , .
  • .
  • ( ).

, ( ), , . Hive, " ", .

, , : part_col = 1, , : part_col = '1'.

, .

-1

Source: https://habr.com/ru/post/1598377/


All Articles