RDD.union与SparkContex.union [英] RDD.union vs SparkContex.union
本文介绍了RDD.union与SparkContex.union的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
两者之间有什么区别
reduce(lambda x,y: x.union(y), myRDDlist)
调用 RDD.union 和
sc.union(myRDDlist)
调用 SparkContext .union ?
它们是否编译为相同的代码?
Do they compile to the same code?
推荐答案
RDD.union 是等效的.
缩小RDD列表并调用RDD.union将导致几个嵌套的UnionRDD(相互引用),其中对SparkContext.union的调用将仅导致单个UnionRDD.
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.
这篇关于RDD.union与SparkContex.union的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文