Guest User

Untitled

a guest
Apr 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. RDD1= ((A, (2, 3, 4), (B, (4, 4, 4)), (A, (4, 5)))
  2. Z = (1, 4)
  3.  
  4. (((A, 4), 2), ((B, 4), 1))
  5.  
  6. 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