Let us say I have the following two RDDs, with the following key-pair values.
rdd1 = [ (key1, [value1, value2]), (key2
I would union the two RDDs and to a reduceByKey to merge the values.
(rdd1 union rdd2).reduceByKey(_ ++ _)
Just use join and then map the resulting rdd.
join
map
rdd1.join(rdd2).map(case (k, (ls, rs)) => (k, ls ++ rs))