Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARK 0.19 KB | None | 0 0
  1. r1 = lines.map(lambda x: x.split("\n"))
  2. r2 = r1.map(lambda x: x[0].split(','))
  3. r2.take(10)
  4. r3 = r2.map(lambda x: ( x[2].split('-')[0], x[12]))
  5. r4 = r3.groupByKey().mapValues(list).collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement