Joining RDDs in Spark per partition to avoid shuffle

Viewed 46

I have to perform a join between two rdds, of the form rdd1.join(rdd2).

In order to avoid shuffling, I have partitioned the two rdds based on the expected queries. Both of them have the same number of partitions, generated using the same partitioner.

The problem is now reduced to a per-partition join, i.e. I'd like to join partition i from rdd1 with partition i from rdd2 and collect the results.

How can this be achieved (in scala)?

0 Answers
Related