RDD.union vs SparkContex.union

前端 未结 1 1911
感动是毒
感动是毒 2021-01-03 04:40

What is the difference between

reduce(lambda x,y: x.union(y), myRDDlist)

which calls RDD.union and

sc.union(myRDDlist)


        
相关标签:
1条回答
  • 2021-01-03 05:37

    SparkContext.union and RDD.union are equivalent, if you have two RDDs.

    Reducing over a list of RDDs and calling RDD.union will result in several nested UnionRDDs (referencing each other), where the call to SparkContext.union will result in only a single UnionRDD.

    0 讨论(0)
提交回复
热议问题