Skip to content

Instantly share code, notes, and snippets.

@oeddyo
Last active August 29, 2015 14:04
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 oeddyo/d4c57ea2865a177979ae to your computer and use it in GitHub Desktop.
Save oeddyo/d4c57ea2865a177979ae to your computer and use it in GitHub Desktop.
Data:
user url
1 www.twitter
2 www.yahoo.com
1 www.google.com
1 www.twitter.com
Output:
1 www.twitter.com:2,www.google.com:1
2 www.yahoo.com
doing something like
def countUrlForUser(??) = {
//some how concat the url count and user id here
}
dataPipe.groupBy(u: (Long, String) => (u._1, u._2))
.mapValues(countUrlForUser??)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment