Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RDD1= ((A, (2, 3, 4), (B, (4, 4, 4)), (A, (4, 5)))
- Z = (1, 4)
- (((A, 4), 2), ((B, 4), 1))
- val newRDD = RDD1.map{case(x, y) => for(i <- 0 to (z.size-1)){if(y.contains(z(i))) {((x, z(i)), 1)}}}
Add Comment
Please, Sign In to add comment