0

How to set limit on cassandra DB and set the range not just limit because I have to find 10 to 100 record from cassandra DB

I have one table user i want to search only 100 user then next 100 use means i want to paginate it so Please tell me How this can implement in our cassandra (CQL)

user3359503
  • 31
  • 1
  • 7

1 Answers1

0

You can use datastax java driver for the same, its very easy to use. http://www.datastax.com/documentation/developer/java-driver/2.0/java-driver/quick_start/qsSimpleClientCreate_t.html

And please refer the following http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0

kkmishra
  • 699
  • 4
  • 10
  • I didn't want to connect with cassandra just want to knw about if we have 1 table with 10000 record then select * from table_name limit 0,25 I just wanted to write this query in cql – user3359503 Jun 04 '14 at 08:14
  • you can do it by using some condition in where clause like, select * form table where token(idcolumn-name) > tokeb(idcolumn-value) limit 20. For next time provide the last row key vaule as idcolumn-value. – kkmishra Jun 04 '14 at 09:47
  • but you cannot do it with pagination if then tell me how you can paginate the data – user3359503 Jun 05 '14 at 10:34
  • Like first fetch some i.e. 20 row using limit and where clause on start key, and in next iteration use 20th rowkey as a start key and after that 40th rowkey and so on... – kkmishra Jun 05 '14 at 10:46