Field Operations Table partition table hive

 

1. hive new field in the partition table

ALTER  Table table_name the Add Columns (column_new_name column_new_type [ Comment 'Comment' ] ); 

- Example 
ALTER  Table db.own_cust the Add Columns (login_cnt int Comment ' logins ' , LoginTime Comment String " login time " );

2. hive modify the field names, field types, field order

    # Hive, the first after only add field, and then sort operation.

ALTER TABLE table_name [PARTITION partition_spec] CHANGE [COLUMN] col_old_name col_new_name column_type
[COMMENT col_comment] [FIRST|AFTER column_name] [CASCADE|RESTRICT];

-- 实例1(修改列名)

 

Guess you like

Origin www.cnblogs.com/tianxiong/p/11412378.html
Recommended