参考链接:
- https://blog.csdn.net/WYpersist/article/details/79797075
- https://blog.csdn.net/baidu_29843359/article/details/46967473
- http://blog.sina.com.cn/s/blog_6ff05a2c010178qd.html map数的计算
- https://blog.csdn.net/wisgood/article/details/42125367 reduce数的计算
- https://segmentfault.com/q/1010000006692189/a-1020000006692368 Full GC相关
- https://blog.csdn.net/weixin_38750084/article/details/82713157 HiveQL如何排查数据倾斜问题
- https://blog.csdn.net/djd1234567/article/details/51581201 文件合并和压缩
查看hive参数:set -v
1、sql中存在的查询操作无直接关联,可以并行执行。如union all操作,可以开启并行执行。
<!--开启任务并行执行—>
set hive.exec.parallel=true;
<!-- 同一个sql允许并行任务的最大线程数—>
set hive.exec.parallel.thread.number=8;
2、数据倾斜调优
数据倾斜产生原因:
(1)group by 维度过小,某一值的数量过多,导致处理此值的reduce非常耗时。
(2)count(distinct x) 某特殊值过多,处理此特殊值的reduce耗时。
(3)join a.小表关联大表,其中小表的关联键key比较集中,导致分发到某一个或某几个reduce的数据远高于平均值。
b.大表关联大表时,关连键key中空值特别多,导致这些空值都进入到一个reduce里,使此reduce运行慢。
数据倾斜体现:
(1) 某个reduce task 运行时间特别长,卡在99%半天不动。
(2) 任务超时被杀掉,Reduce处理的数