如何处理“无法在300秒内执行广播”?

问题描述

我正在尝试使构建正常工作,并且其中一个阶段间歇性地失败,并出现以下错误

printf.S

我应该如何处理此错误

解决方法

首先,让我们谈谈该错误的含义。

摘自Spark官方文档(http://spark.apache.org/docs/latest/programming-guide.html#broadcast-variables):

Broadcast variables allow the programmer to keep a read-only variable cached on each machine rather than shipping a copy of it with tasks. They can be used,for example,to give every node a copy of a large input dataset in an efficient manner. Spark also attempts to distribute broadcast variables using efficient broadcast algorithms to reduce communication cost.

根据我的经验,广播超时通常在输入数据集之一的分区不佳时发生。建议您查看数据集的分区,并确保它们已正确分区,而不是禁用广播。

我使用的经验法则是将数据集的大小(以MB为单位)除以100,然后将分区数设置为该数。由于HDFS块大小为125 MB,我们希望将文件溢出到125 MB左右,但是由于它们不能很好地分割,我们可以用较小的数字进行划分以获得更多分区。

主要是非常小的数据集(〜