Skip to content

Instantly share code, notes, and snippets.

@nivdul
Created April 19, 2015 15:00
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 nivdul/6424b9b21745d8718036 to your computer and use it in GitHub Desktop.
Save nivdul/6424b9b21745d8718036 to your computer and use it in GitHub Desktop.
create bucket of sorted data by ascending timestamp by (user, activity)
// create bucket of sorted data by ascending timestamp by (user, activity)
JavaRDD<Long> times = cassandraRowsRDD.select("timestamp")
.where("user_id=? AND activity=?", i, activity)
.withAscOrder()
.map(CassandraRow::toMap)
.map(entry -> (long) entry.get("timestamp"))
.cache();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment