I have 2 RDD[Int] sources and noSourcesVertex. I would like to compute a map that would create 2 new RDD.
val sourcesFormatted = sources.map(x => (Some(x), (Some(x), Some(x))))
val noSourcesVertexFormatted = noSourcesVertex.map(x => (Some(x), (Some(x), None)))
val outInit = sourcesFormatted.union(noSourcesVertexFormatted)
But when I'm executing the precedent code, I have an error :
error: type mismatch; found : org.apache.spark.rdd.RDD[(Some[Int], (Some[Int], None.type))] required: org.apache.spark.rdd.RDD[(Some[Int], (Some[Int], Some[Int]))] val outInit = sourcesFormatted.union(noSourcesVertexFormatted)
I think this error happens because I'm trying to join 2 RDD whose 3rd column has different type.
I wasn't expecting this behaviour because of what I anderstood of the Option's mecanism, Some(something) and None has the same type -> Option.
Why do I have this error though ?