Pair RDD转化操作 val rdd = sc.parallelize(List((1,2),(3,4),(3,6))) //reduceByKey,通过key来做合并val r1 = rdd.reduceByKey((x,y)=>x+y).collect()val r1 = rdd.reduceByKey(_+_).collect()res0: Array[(Int, Int)] = Array((1,2), (3,10)) val r1 = rdd.reduceByKey((x,y)=>…