Spark Scala當中reduceByKey(_+_) reduceByKey((x,y) => x+y)的用法 ...
[學習筆記]
reduceByKey(_+_)是reduceByKey((x,y) => x+y)的一個 簡潔的形式
*/
val rdd08 = sc.parallelize(List((1, 1), (1, 4),(1, 3), (3, 7), (3, 5)))
val rdd08_1 = rdd08.reduceByKey((x, y) => x + y)
println("reduceByKey 用法 " + rdd08_1.collect().mkString(","))
sc.stop()
}
def myunion(rdd05: RDD[Int], rdd06: RDD[Int]): Unit = {
val res: RDD[Int] = rdd05.union(rdd06)
文章轉載自原文:https://blog.csdn.net/qq_44596980/article/details/93311988