Reputation: 73
I know if I want to transform xs: RDD[Option[T]] to List[T]
, I simply write
xs.flatten
Now if I have a rs:RDD[(Option[T], S)]
How do I transform this to
RDD[T, S]
if there is any option other than calling filter and map.
Upvotes: 1
Views: 95
Reputation: 2124
You can call map and use pattern matching:
rs.map {case (Some(t), s) => t->s}
Upvotes: 1