Skip to content

Instantly share code, notes, and snippets.

@darionyaphet
Created March 20, 2017 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darionyaphet/f7dceac12d333af74c5670b9a19e8f9a to your computer and use it in GitHub Desktop.
Save darionyaphet/f7dceac12d333af74c5670b9a19e8f9a to your computer and use it in GitHub Desktop.
file
.map(line => (line.split(",")(0), 1))
.reduceByKey(_ + _)
.map(item => item.swap)
.sortByKey(false)
.map(item => item.swap)
.take(20)
.foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment