在一个几年的旧表,表最后面,新增字段

alter table dwd.dwd_xxx_dtl_di
add columns(
`line_type` string COMMENT 'xx类型'
) cascade;

插入语句,新增字段一定在select语句最后面。不然字段会错位

insert select  ... , line_type

 

删除分区

alter table ods_fop_distribution.fop_dbt_withdraw_apply drop partition (inc_day<='20240606');

-- 新增字段
alter table ods_cemp.t_activity_bounty_promotion_stored_action
add columns(
`user_name_encrypt` string COMMENT '用户名密文'
) cascade;

 

posted on 2022-06-09 14:00  架构艺术  阅读(128)  评论(1编辑  收藏  举报