当我在Spark程序中达到资源限制时,我想将处理分为多个迭代,并将每个迭代的结果上传到HDFS,如下所示。

do something using first rdd
upload the output to hdfs

do something using second rdd
upload the output to hdfs

但据我所知,Spark将尝试并行运行这两个。有没有办法在处理第二个rdd之前等待第一个rdd的处理?

最佳答案

我想我知道您感到困惑的地方。在单个RDD中,分区将彼此并行运行。但是,两个RDD将彼此顺序运行(除非您另有编码)。

07-26 08:50
查看更多