'How to get incremental data from Apache cassandra?

I want to get incremental data, that is each call to select query should returns new records. For ex. let's say my table has 1 million records and I am using Spring boot application so I don't want to fetch all the records at once. I want the records recursively like in the chunks of 10k records or any number.

Once I get the records let's say 10k, in the next iteration I need other 10k and so on.

How can I do it in Apache Cassandra?



Solution 1:[1]

You want Pagination in Cassandra, Cassandra has the SELECT with LIMIT but not the built-in "SKIP" functionality.

Is not easy to implement it, but try this approach see the example: https://docs.datastax.com/en/archived/cql/3.1/cql/cql_reference/select_r.html#reference_ds_d35_v2q_xj__paging-through-unordered-results

The other option you need to implement in client/driver side. https://shivanshugoyal0111.medium.com/pagination-in-cassandra-b7e45ec2656a

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Adelino Silva