spark的shuffle read和shuffle write有什么区别?

Sri*_*ini 11 apache-spark apache-spark-sql

我需要运行一个包含大量数据的spark程序.我正在尝试优化火花程序并通过spark UI并尝试减少Shuffle部分.

提到了几个组件,shuffle read和shuffle write.我可以根据他们的术语理解差异,但我想了解它们的确切含义以及哪一个spark的shuffle读/写会降低性能?

我在互联网上搜索过,但找不到有关它们的详细信息,所以想知道是否有人可以在这里解释一下.

Car*_*cas 11

从UI工具提示

随机阅读

读取的总洗牌字节和记录(包括本地读取的数据和从远程执行器读取的数据

随机写

写入磁盘的字节和记录,以便在将来的阶段通过随机播放进行读取


Dra*_*yar 2

我最近开始使用 Spark。我一直在寻找同类问题的答案。

当一个阶段的数据通过网络转移到下一个阶段时,处理下一个阶段的执行器通过 TCP 从第一个阶段的进程中提取数据。我注意到每个阶段的随机“写入”和“读取”指标都显示在特定作业的 Spark UI 中。阶段还可能具有“输入”大小(例如,来自 HDFS 或 hive 表扫描的输入)。

I noticed that the shuffle write size from one stage that fed into another stage did not match that stages shuffle read size. If I remember correctly, there are reducer-type operations that can be performed on the shuffle data prior to it being transferred to the next stage/executor as an optimization. Maybe this contributes to the difference in size and therefore the relevance of reporting both values.