我無法在Spark文檔操作中找到導致洗牌和操作的操作。在這個列表中,哪些會導致洗牌,哪些不會呢?導致洗牌的Spark轉換是什麼?
地圖和過濾器沒有。但是,我不確定與其他人。
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)
這只是關於編程一般好點的實際 - 通過閱讀代碼,並使用代碼在閱讀文檔,回答問題。文檔通常可能包含信息的重複,並且重複會帶來錯誤和信息丟失。在閱讀代碼時,人們可以知道*究竟*發生了什麼:) – samthebest 2014-12-07 10:34:04
根據文檔,'toDebugString'返回「此RDD的描述及其用於調試的遞歸依賴關係。」因此,如果它們存在,即使最近的轉型沒有發生洗牌,它也將包括可能的來自先前轉型的洗牌,對吧? – 2018-03-01 05:10:59