How to reverse the result of reduceByKey using RDD API?
问题 I have a RDD of (key, value) that I transformed into a RDD of (key, List(value1, value2, value3) as follow. val rddInit = sc.parallelize(List((1, 2), (1, 3), (2, 5), (2, 7), (3, 10))) val rddReduced = rddInit..groupByKey.mapValues(_.toList) rddReduced.take(3).foreach(println) This code give me the next RDD : (1,List(2, 3)) (2,List(5, 7)) (3,List(10)) But now I would like to go back to the rddInit from the rdd I just computed (the rddReduced rdd). My first guess is to realise some kind of