1. 程式人生 > >hive表新增欄位和欄位註釋修改

hive表新增欄位和欄位註釋修改

hive表新增欄位,修改欄位的註釋

(1)建立測試表:

use mart_flow_test;
create table if not exists mart_flow_test.detail_flow_test
(
    union_id          string    comment '裝置唯一標識'
) comment '測試表'
partitioned by (
    partition_date    string    comment '日誌生成日期'
) stored as orc;

(2)新增欄位:use mart_flow_test;

    alter table detail_flow_test add columns(original_union_id string);

(3)修改註釋:use mart_flow_test;

    alter table detail_flow_conversion_base_raw change column original_union_id original_union_id string COMMENT'原始裝置唯一性標識’;