配置单元:插入查询失败,错误为“java.lang.outofmemoryerror:超出gc开销限制”

p5cysglq  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(385)

我的配置单元插入查询失败,出现以下错误:java.lang.outofmemoryerror:超出gc开销限制
表2中的数据=1.7tb查询:

set hive.exec.dynamic.partition.mode= nonstrict;set hive.exec.dynamic.partition=true;set mapreduce.map.memory.mb=15000;set mapreduce.map.java.opts=-Xmx9000m;set mapreduce.reduce.memory.mb=15000;set mapreduce.reduce.java.opts=-Xmx9000m;set hive.rpc.query.plan=true;
insert into database1.table1 PARTITION(trans_date) select * from database1.table2;

错误信息:启动作业1(共1个reduce任务)设置为0,因为没有reduce运算符失败:执行错误,从org.apache.hadoop.hive.ql.exec.mr.mapredtask返回代码-101。超出gc开销限制
群集信息:总内存:1.2tb总vCore:288总节点:8节点版本:2.7.0-mapr-1808
请注意:我试图插入表2的数据,这是在Parquet格式的表1是在orc格式。数据总量为1.8tb。

7bsow1i6

7bsow1i61#

添加distribute by partition key可以解决以下问题:

insert into database1.table1 PARTITION(trans_date) select * from database1.table2
distribute by trans_date;
``` `distribute by trans_date` 将触发reducer步骤,并且每个reducer将处理单个分区,这将减少内存压力。当每个进程写入许多分区时,它在内存中为orc保留了太多的缓冲区。
还可以考虑添加此设置来控制每个reducer将处理多少数据:

set hive.exec.reducers.bytes.per.reducer=67108864; --this is example only, reduce the figure to increase parallelism

相关问题