[官网解读]Spark Shuffle

Shuffle是Spark中一种复杂的、代价高昂的数据重新分布机制,用于跨分区重组数据。它涉及到磁盘I/O、数据序列化和网络I/O。reduceByKey、groupByKey等操作会导致Shuffle,而Shuffle操作可能导致大量中间文件生成,占用磁盘空间。可以通过调整配置参数来优化Shuffle行为。
摘要由CSDN通过智能技术生成

Shuffle operations

Certain operations within Spark trigger an event known as the shuffle. The shuffle is Spark’s mechanism for re-distributing data so that it’s grouped differently across partitions. This typically involves copying data across executors and machines, making the shuffle a complex and costly operation.

Spark内部的某种操作会触发一个叫Shuffle的事件。Shuffle是Spark重新分发数据的机制,以便跨分区做不同的分组。Shuffle通常包括跨执行器和节点复制数据,这使得Shuffle成为一种复杂且昂贵的操作。

Background

To understand what happens during the shuffle, we can consider the example of the reduceByKey operation. The reduceByKey operation generates a new RDD where all values for a single key are combined into a tuple - the key and the result of executing a reduce function against all values associated with that key. The challenge is that not all values for a single key necessarily reside on the same partition, or even the same machine, but they must be co-located to compute the result.

要理解Shuffle期间发生了什么,我们可以以reduceByKey为例。reduceByKey操作生成一个新的RDD,其中单个键的所有值都被组合成一个元组——该键和对与该键相关的所有值执行reduce函数的结果。挑战在于,并不是单个键的所有值都必须位于同一个分区,甚至同一台机器上,但它们必须在同一位置才能计算结果

In Sp

  • 64
    点赞
  • 47
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

傻么老幺

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值