我在Spark文档中难以找到导致洗牌(shuffle)和不导致的操作。在这个列表中,哪些操作会导致洗牌(shuffle),哪些不会?
map和filter不会导致洗牌(shuffle)。然而,其他操作我不确定。
map(func)
filter(func)
flatMap(func)
mapPartitions(func)
mapPartitionsWithIndex(func)
sample(withReplacement, fraction, seed)
union(otherDataset)
intersection(otherDataset)
distinct([numTasks]))
groupByKey([numTasks])
reduceByKey(func, [numTasks])
aggregateByKey(zeroValue)(seqOp, combOp, [numTasks])
sortByKey([ascending], [numTasks])
join(otherDataset, [numTasks])
cogroup(otherDataset, [numTasks])
cartesian(otherDataset)
pipe(command, [envVars])
coalesce(numPartitions)
toDebugString
返回“用于调试的此 RDD 及其递归依赖项的说明。” 因此,即使最近的转换不涉及 shuffle,它也将包括来自先前转换的可能 shuffle,对吗? - CyberPlayerOne