Now I have 3 RDDs like this:
rdd1:
1 2
3 4
5 6
7 8
9 10
rdd2:
11 12
13 14
rdd3:
15 16
17 18
19 20
and I want to do this:
rdd1.zip(rdd2.union(rdd3))
and I want the result is like this:
1 2 11 12
3 4 13 14
5 6 15 16
7 8 17 18
9 10 19 20
but I have an exception like this:
Exception in thread "main" java.lang.IllegalArgumentException: Can't zip RDDs with unequal numbers of partitions
someone tell me I can do this without exception:
rdd1.zip(rdd2.union(rdd3).repartition(1))
But it seems like it is a little cost. So I want to know if there is other ways to solve this problem.