"Stage Skipped" 在 Apache Spark web UI 中是什么意思?

What does "Stage Skipped" mean in Apache Spark web UI?

来自我的 Spark UI。跳过是什么意思?

通常这意味着数据已从缓存中获取,不需要 re-execute 给定阶段。它与您的 DAG 一致,表明下一阶段需要洗牌 (reduceByKey)。每当涉及洗牌时 Spark automatically caches generated data:

Shuffle also generates a large number of intermediate files on disk. As of Spark 1.3, these files are preserved until the corresponding RDDs are no longer used and are garbage collected. This is done so the shuffle files don’t need to be re-created if the lineage is re-computed.

假设您有一个包含一些数据的初始数据框。现在您在其上执行几个转换并对最终数据框执行多个操作。如果你缓存了一个数据框,那么当你调用一个动作时它就会具体化,并以具体化的形式保存在内存中。因此,当调用下一个动作时,它将遍历整个 DAG,并且在这样做时,它会看到数据帧已被缓存,因此它将通过利用它在内存中以物化形式存在的已经就绪状态来跳过这些阶段。

当它跳过阶段时,你会看到它在火花中被跳过 UI 并且它加快了你的操作,因为它不必从根计算 dag 并且可以在缓存数据框。