Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

Willy06 avatar image
Willy06 asked ·

cqlsh in ccm only returns 100 rows

Hi,

I work with ccm. When I do a select on a table:

ccm node1 cqlsh -e "select * from keyspace.table;"

I always get 100 records and not more, even if there are more records than 100.

Someone could help me on this topics, as it seemes that there is like a LIMIT 100 ?

Thanks.

William

Finally, I found the solution:

ccm node1 cqlsh -e "paging 500; select * from TABLE;" to get 500 rows. paging off to get the max.

William.


ccm
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

[EDITED] If you have PAGING enabled in cqlsh, it will only return 100 rows by default.

With paging disabled, cqlsh will return 5000 rows. You can override the default by specifying a higher limit for your query. For example:

SELECT * FROM table_name LIMIT 10000;

As a side note, if you're just trying out Cassandra then I'd recommend using Astra -- you can launch a free tier Cassandra cluster in just a few clicks, ready to use in a couple of minutes with zero configuration. Cheers!

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi,

I have not seen the recommendation using Astra.

SELECT ... FROM ... LIMIT 1000; does not work. I already tried this.

Thanks anyway.

0 Likes 0 ·