Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val asd = all.map(x => (x._1, (x._2._1._3, x._2._2)))
- //line //age //set //set
- val moviesAvgByAge = asd.map(x => (x._2._1, x._2._2)).flatMap(x => x._2.map(y => ((x._1, y._1), y._2))).groupByKey
- .mapValues(x => (x.reduce(_ + _).toFloat / x.size))//.top(10)(Ordering[(Float, String)].on(x => (x._2, x._1._2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement