This function seems valid for my IDE:
def zip[T, U](rdd1:RDD[T], rdd2:RDD[U]) : RDD[(T,U)] = {
rdd1
.zipWithIndex
.map(_.swap)
.join(
rdd2
.zipWithIndex
.map(_.swap))
.values
}
But when I compile, I get :
value join is not a member of org.apache.spark.rdd.RDD[(Long, T)] possible cause: maybe a semicolon is missing before `value join'? .join(
I am in Spark 1.6, I have already tried to import org.apache.spark.rdd.RDD._ and the code inside the function works well when it is directly used on two RDDs outside of a function definition.
Any idea ?