Impala合并小文件

2021-11-26  本文已影响0人  无量儿

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;

https://www.pianshen.com/article/466643134/

上一篇下一篇

猜你喜欢

热点阅读