From doc of CQL3 v4,page_state can only be used for same query for getting next page.
However, the QUERY consists of <query>
and <query_parameters>
, also from the doc. At least <paging_state>
field in <query_parameters>
will be replaced with new value. So how to tell two queries are same?
Maybe my assumption is wrong that <paging_state>
is the same for all next paging queries.
No 2 queries will be exactly the same. Each has a unique to the connection stream id. The paging state passed down in the response of 1 query can be returned in the same query to adjust where the query starts and to track how many results to return (based on limit of the 1st). Note that the paging state is the last partition and row returned with amount to return remaining total and within current partition (two byte arrays, two integers).
The driver wont allow it - but if you change your query and pass a paging state from a different request it can have weird results. Especially if the paging state was from a table with different schema it could result in an error when it tries to compare keys.