Paginating over rows in a partition

As our users create more and more  status updates, we'll build pagination functionality into MyStatus so that the information on the page doesn't overwhelm readers. For the sake of convenience, let's say that each page will only contain three status updates.

To retrieve the first page, we'll use the LIMIT keyword that we first encountered in Chapter 2, The First Table:

SELECT "id", DATEOF("id"), "body"FROM "user_status_updates"WHERE "username" = 'alice'LIMIT 3;

As expected, Cassandra will give us the first three rows in ascending order of id:

Now, we'll ask for the collection of rows where the id value ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.