set compression_codec=snappy;
set parquet_file_size=512M;
create table if not exists xx.xxx_tmp like xx.xxx;
insert overwrite xx.xxx_tmp partition(etl_dt)
select * from xx.xxx where substring(etl_dt,1,7)='2020-02';
--删除指定月的分区数
alter table xx.xxx drop partition(substring(etl_dt,1,7)='2020-02');
--将备份分区数据重新插入
insert into xx.xxx partition(etl_dt)
select * from xx.xxx_tmp;
drop table if exists xx.xxx_tmp;
set parquet_file_size=256M;
网友评论