hive表新增字段和字段注释修改

时间:2024-05-20 14:10:38

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'原始设备唯一性标识’;

hive表新增字段和字段注释修改