Mapper 倾斜和输入分割大小

问题描述

我有一个分区的 Hive 外部表,其中的数据存储在 s3 中。让我们假设该表由两列(ds STRING,源 STRING)分区。

底层 s3 路径如下所示:

s3://..../ds=2021-05-01/source=a/,s3://..../ds=2021-05-01/source=b/,s3://..../ds=2021-05-01/source=c/...

这些目录下的文件以镶木地板格式存储。所以它们看起来像 part-00000.gz.parqet...

查看 Yarn 日志,我试图了解当我对该表运行 select 语句时 Tez 如何对输入拆分进行分组。我已经浏览了 documentation,但它没有涉及到局部性的细节。

SELECT col1,col2,col3
FROM   table
WHERE  ds = '2021-05-01'


aws s3 ls s3://..../ds=2021-05-01/source=a/` --> Total 500 files total size = 53491615523
aws s3 ls s3://..../ds=2021-05-01/source=b/` --> Total 20 files total size = 3285723392
aws s3 ls s3://..../ds=2021-05-01/source=c/` --> Total 20 files total size = 3987652646
 
Total files = 540 total size = 60764991561

纱线日志

|mapred.FileInputFormat|: Total input files to process : 540 -> I understand this from above 
|io.HiveInputFormat|: number of splits 1120 ->  I don't get this line
|tez.HiveSplitGenerator|: Number of input splits: 1120. 430 available slots,1.7 waves. -> understand this as 430 is headroom and wavefactor is 1.7
|tez.SplitGrouper|: Estimated number of tasks: 731 for bucket 1 ->  it makes sense as 430 * 1.7 = 731
|grouper.TezSplitGrouper|: Desired numSplits: 731 lengthPerGroup: 83125843 numLocations: 1 numSplitsPerLocation: 1120 numSplitsInGroup: 1 totalLength: 60764991561 numOriginalSplits: 1120 . Grouping by length: true count: false nodeLocalOnly: false -> 
everything makes sense here. I didn't specify tez.grouping.max-size or tez.grouping.min-size. So default value for min-size is 50MB. 60764991561/731 = 83125843 (lengthsPerGroup)

根据我的理解,lengthsPerGroup 介于 50 MB(最小大小的默认值)和 1GB(mx 大小的默认值)之间,因此它转到节点位置和/机架位置

|grouper.TezSplitGrouper|: Doing rack local after iteration: 869 splitsProcessed: 1119 numFullGroupsInRound: 0 totalGroups: 868 lengthPerGroup: 62344380 numSplitsInGroup: 1
|grouper.TezSplitGrouper|: Allowing small groups after iteration: 870 splitsProcessed: 1119 numFullGroupsInRound: 0 totalGroups: 868
|grouper.TezSplitGrouper|: Number of splits desired: 731 created: 869 splitsProcessed: 1120
|tez.SplitGrouper|: Original split count is 1120 grouped split count is 869,for bucket: 1

我不知道它是如何得出这些数字的 4 行以上

为什么我要读取 Yarn 日志?

如果我设置

SET tez.grouping.max-size=2254857830;
SET tez.grouping.min-size=2147483648;

然后我从 Tez UI 中注意到,与剩余的 28 个相比,从这 2 个映射器中生成 30 个映射器需要更长的时间才能完成。平均任务持续时间为 124 秒,而最大持续时间为 225 秒。此外,这两个落后者各有 s3_bytes_read ~ 500M,而其余各有 ~170M。对于所有 30 个映射器 input split bytes = ~2G,除了一个(可能得到剩余字节)

如果您能帮助我理解其背后的原因,我将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...