0
我有我的最后RDD,它看起来像:火花蟒蛇转换RDD元组的元组嵌套进事务所的元组
(44, (136.38, 2))
(2, (108.53, 3))
(4, (24.13, 1))
(35, (65.89, 1))
我想有它的形式:
(44, 136.38, 2)
(2, 108.53, 3)
(4, 24.13, 1)
(35, 65.89, 1)
请注意这是一个火花RDD,创造出另外两个RDDS的:
combined = reduced_total.join(reduced_count)
我可以完成这个任务:
combined = combined.map(lambda x: (x[0],x[1][0],x[1][1]))
但它似乎很Python的。任何更好的建议?