If I have two RDDs of the same size but potentially different types, and a binary function to map the two types to a third types, what is the best way to create a new RDD where each element is a combination of the corresponding two elements of the original RDDS?
def map2[A,B,C](rdd1:RDD[A], rdd2:RDD[B], f:(A,B)=>C)): RDD[C] = {
…
}
Does the fact that I’m asking this question already mean I’m approaching the problem completely wrong?