>>> rdd.collect()
[(2, 3, 1, 4), (1, 2, 3, 4), (1, 2, 4, 3), (3, 1, 2, 4), (2, 4, 3, 1), (4, 3,
2, 1), (4, 1, 3, 2), (1, 4, 2, 3), (4, 2, 1, 3), (2, 4, 1, 3), (4, 3, 1, 2),
(3, 4, 2, 1), (3, 2, 4, 1), (2, 1, 4, 3), (4, 1, 2, 3), (2, 1, 3, 4), (3, 4,
1, 2), (1, 3, 4, 2), (3, 2, 1, 4), (2, 3, 4, 1), (1, 3, 2, 4), (4, 2, 3, 1),
(1, 4, 3, 2), (3, 1, 4, 2)]
>>> rdd.flatMap(lambda x: map(lambda e:e, x)).collect()
[2, 3, 1, 4, 1, 2, 3, 4, 1, 2, 4, 3, 3, 1, 2, 4, 2, 4, 3, 1, 4, 3, 2, 1, 4,
1, 3, 2, 1, 4, 2, 3, 4, 2, 1, 3, 2, 4, 1, 3, 4, 3, 1, 2, 3, 4, 2, 1, 3, 2, 4,
1, 2, 1, 4, 3, 4, 1, 2, 3, 2, 1, 3, 4, 3, 4, 1, 2, 1, 3, 4, 2, 3, 2, 1, 4, 2,
3, 4, 1, 1, 3, 2, 4, 4, 2, 3, 1, 1, 4, 3, 2, 3, 1, 4, 2]
里面的map做了什么操作?
--
FROM 119.139.196.*