hadoop - Hive Tez 减速器运行速度超慢
问题描述
我加入了多个表,总行数约为 250 亿。最重要的是,我正在做聚合。这是我的配置单元设置,如下所示,我用它来生成最终输出。我不确定如何调整查询并使其运行得更快。目前,我正在反复试验,看看是否能产生一些结果,但这似乎不起作用。映射器运行得更快,但减速器需要永远完成。有人可以分享您对此的想法吗?谢谢你。
SET hive.execution.engine=tez;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.qubole.cleanup.partial.data.on.failure=true;
SET hive.tez.container.size=8192;
SET tez.task.resource.memory.mb=8192;
SET tez.task.resource.cpu.vcores=2;
SET hive.mapred.mode=nonstrict;
SET hive.qubole.dynpart.use.prefix=true;
SET hive.vectorized.execution.enabled=true;
SET hive.vectorized.execution.reduce.enabled =true;
SET hive.cbo.enable=true;
SET hive.compute.query.using.stats=true;
SET hive.stats.fetch.column.stats=true;
SET hive.stats.fetch.partition.stats=true;
SET mapred.reduce.tasks = -1;
SET hive.auto.convert.join.noconditionaltask.size=2730;
SET hive.auto.convert.join=true;
SET hive.auto.convert.join.noconditionaltask=true;
SET hive.auto.convert.join.noconditionaltask.size=8053063680;
SET hive.compute.query.using.stats=true;
SET hive.stats.fetch.column.stats=true;
SET hive.stats.fetch.partition.stats=true;
SET mapreduce.job.reduce.slowstart.completedmaps=0.8;
set hive.tez.auto.reducer.parallelism = true;
set hive.exec.reducers.max=100;
set hive.exec.reducers.bytes.per.reducer=1024000000;
SQL:
SELECT D.d
,D.b
,COUNT(DISTINCT A.x) AS cnt
,SUM(c) AS sum
FROM A
LEFT JOIN
B
ON A.a = B.b
LEFT JOIN
C
ON B.b = C.c
JOIN
D
ON A.a >= D.d
AND A.a <= D.d
GROUP BY 1,2
CLUSTER BY D.d;
解决方案
还没有查询计划,所以也许还有别的东西,但这些设置肯定会限制减速器的并行性:
set hive.exec.reducers.max=100;
set hive.exec.reducers.bytes.per.reducer=1024000000;
我建议增加允许的减速器数量并减少每个减速器的字节数,这将增加减速器的并行度:
set hive.exec.reducers.max=5000;
set hive.exec.reducers.bytes.per.reducer=67108864;
Hive 1.2.0+ 还为 count(distinct) 提供了自动重写优化。检查这个设置,它应该是true
默认的:
hive.optimize.distinct.rewrite=true;
如果查询停留在最后一个 reducer 上,则连接键存在偏差
推荐阅读
- kotlin - arrow-kt 中是否有类似 ap2、ap3 的功能?
- regex - 如何在excel VBA中使用正则表达式突出显示温度字符串
- laravel - 如果没有该id的记录获取该id的增量并在laravel中获取记录,如何使用id从数据库中获取记录
- google-maps - Flutter Google Maps - 根据行车方向旋转标记
- perl - 如何从模块创建 RPM 并递归地为依赖项创建单独的独立 RPM?
- mysql - 安装 MySQL 的虚拟机内存负载问题
- javascript - 删除画布中上传的图像
- c# - 当单词以方括号等特殊字符开头或结尾时,单词边界不匹配
- java - 如何为 Stripe Android 字符串添加本地化?
- android - firebaserealtimedatabase版本数据保存错误