foo = sc.parallelize([(1, ('a', 'b')), (2, ('c', 'd')), (1, ('x', 'y'))])
foo.map(lambda x_y: (x_y[0], [x_y[1]])).reduceByKey(lambda p, q: p + q).collect()
Reduce a key-value pair into a key-list pair with Apache Spark