I have an rdd of the following form:
rdd = sc.parallelize([(2, [199.99, 250.0, 129.99]),
(4, [49.98, 299.95, 150.0, 199.92]),
(8, [179.97, 299.95, 199.92, 50.0]),
(10, [199.99, 99.96, 129.99, 21.99, 199.99]),
(12, [299.98, 100.0, 149.94, 499.95, 250.0])])
I need it to be flattened to this form:
2,199.99
2,250.0
2,12.99
4,49.98
4.299.95
...
It also has to be ordered by either the first or the second field.
How to achieve that?
Thanks.