Hive ERROR: Out of memory due to hash maps used in map-side aggregation
什么时候hive在运行大数据量的统计查询语句时。常常会出现以下OOM错误。详细错误提演示样例如以下:
Possible error: Out of memory due to hash maps used in map-side aggregation. Solution: Currently hive.map.aggr.hash.percentmemory is set to 0.5. Try setting it to a lower value. i.e 'set hive.map.aggr.hash.percentmemory = 0.25;'
查看task的失败信息为:
Error:GC overhead limit exceeded
对于这个错误,一般是由两种情况造成的:(1) hive sql写的不合理,导致运行时hash map过大;(2)hive sql没有优化的余地了(要得到想要的数据仅仅能写这种sql)。
对于(1)则改变sql语句,从而减少hash map的大小。对于(2)则能够调整參数。
以下分别说明(1)和(2)的情况:
(1)改变sql语句
select count(distinct v) from tbl;
能够改为select count(1) from (select v from tbl group by v) t;
说明:降低了hash map的key个数
select collect_set(messageDate)[0],count(*) from incidents_hive group by substr(messageDate,8,2);
能够改为select hourNum, count(1) from (select substr(messageDate,9,2) as hourNum from incidents_hive ) t group by hourNum;
说明:没有降低hash
map的key个数。可是降低了value的大小
(2)调整參数
对于这个sql语句。是没办法进行优化(由于keywords的反复率非常低。导致map阶段里面维护的一个内存Map对象非常巨大)来减少hash
map大小的:
INSERT OVERWRITE TABLE hbase_table_poi_keywords_count SELECT concat(substr(key,0,8), svccode, keywords), substr(key,0,8), svccode, keywords, count(*) where substr(key,0,8)=\"$yesterday\" AND length(keywords)>0 AND svccode is not null GROUP BY substr(key,0,8),svccode,keywords;
与mapjoin和map aggregate相关的优化參数有:
hive.map.aggr
hive.groupby.mapaggr.checkinterval
hive.map.aggr.hash.min.reduction
hive.map.aggr.hash.percentmemory
hive.groupby.skewindata
以上參数能够查看配置文件说明即文档进行调整。
假设需求确实没法通过调整这些參数来达到,那么set hive.map.aggr=false便是终于的方案,它肯定能满足你需求。仅仅是运行速度比map join 和 map aggr慢些,但通过实际跑数据你非常可能发现事实上它也不慢哈。
參考文章:
http://blog.csdn.net/macyang/article/details/9260777
http://www.myexception.cn/open-source/1487747.html
http://blog.csdn.net/lixucpf/article/details/20458617
INSERT OVERWRITE TABLE hbase_table_poi_keywords_count SELECT concat(substr(key,0,8), svccode, keywords), substr(key,0,8), svccode, keywords, count(*) where substr(key,0,8)=\"$yesterday\" AND length(keywords)>0 AND svccode is not null GROUP BY substr(key,0,8),svccode,keywords;
版权声明:本文博主原创文章,博客,未经同意不得转载。
Hive ERROR: Out of memory due to hash maps used in map-side aggregation的更多相关文章
- Out of memory due to hash maps used in map-side aggregation解决办法
在运行一个group by的sql时,抛出以下错误信息: Task with the most failures(4): -----Task ID: task_201411191723_723592 ...
- 黄聪:wordpress中PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312)(转)
近日在升级wordpress 3.2.1和若干插件的过程中,发现了一个wordpress的错误:Allowed memory size of XXX bytes exhausted Fatal err ...
- PHP运行错最有效解决办法Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744
原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312) Fatal error: Out of memory (allocated ...
- Tomcat7 JDK8 Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000540000000, 5368709120, 0) failed; error='Cannot allocate memory' (errno=12)
[root@crm-web- bin]# shutdown.sh bash: shutdown.sh: command not found [root@crm-web- bin]# sh shutdo ...
- android stdio 编译项目报Error:Failed to find target with hash string 'android-24
android stdio 编译项目报Error:Failed to find target with hash string 'android-24 查看已有的SDK 设置项目的sdk为 25 an ...
- wp8.1 sqlite Error - Deployment optimization failed due to an assembly that's not valid.
这里我们使用的sqlite的版本为3.8.5,vs2013在发布的时候出现 Error - Deployment optimization failed due to an assembly that ...
- Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000fa980000, 59244544, 0) failed; error='Cannot allocate memory' (errno=12)
启动项目报错 Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000fa980000, 592445 ...
- Fatal Error: Out of memory php内存溢出处理三种方法
有时候我们在运行php程序的时候会发现 Fatal Error: Out of memory 这样的提示,这有可能是程序中用到了大量了变量和对象,导致分配的内存不够用. 修改php.ini文件里的me ...
- OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Out of memory' (errno=12)
使用docker 安装kafka时启动失败 查看报错日志 # docker logs --since 30m 71846a96e514 Excluding KAFKA_HOME from broker ...
随机推荐
- pv操作 生产者消费者
#include <iostream> #include <stdlib.h> #include <pthread.h> #include <semaphor ...
- Qt 的内部进程通信机制
Qt 的内部进程通信机制 续欣 (xxin76@hotmail.com), 博士.大学讲师 2004 年 4 月 01 日 Qt 作为一种跨平台的基于 C++ 的 GUI 系统,能够提供给用户构造图形 ...
- ORACLE RMAN介绍
本地连接: $ rman target / or $ rman target / nocatalog 远程连接: $ rman target sys/sys@sky RMAN命令执行方式: 1.单条 ...
- ruby on rails创建的页面訪问很慢
ruby on rails创建的页面訪问很慢 用rvm安装的ruby1.9.3 解决:cd ~/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/webrick v ...
- 深入浅出Windows BATCH
1.什么是Windows BATCH BATCH也就是批处理文件,有时简称为BAT,是Windows平台上的一种可运行脚本,与*nix(Linux和Unix)上的Shell脚本和其它的脚本(Perl, ...
- shu_1241 邮局位置问题
http://202.121.199.212/JudgeOnline/problem.php?cid=1078&pid=5 分析: 由于题目中的距离是折线距离,所以能够分别考虑两个方向.又x方 ...
- FZU1608(线段树)
传送门:Huge Mission 题意:给定区间范围[0,N] (2 <= N <= 50000)和M个区间 (1 <= M <= 500000)和这些区间上的权值,求最终并区 ...
- PAT-B 1015. 德才论(同PAT 1062. Talent and Virtue)
1. 在排序的过程中,注意边界的处理(小于.小于等于) 2. 对于B-level,这题是比較麻烦一些了. 源代码: #include <cstdio> #include <vecto ...
- Linux中下载,压缩,解压等命令
查看是否和还有一台Linux机器相通命令:ssh 主机名@Ip地址 ,提示输入password.就可以查看远程文件的文件夹 下载远程机器上的文件:scp 主机名@Ip地址:/path/s ...
- Struts2 拦截器具体配置过程
拦截器差点儿遍布每个程序中,所以贴出拦截器配置的具体过程,希望可以帮到大家. Struts2 拦截器具体配置过程 <interceptors> <!-- 先定义拦截器 --> ...