I´m using Cassandra 2.0 with CQL3 as query language. Cassandra usually defaults to 10,000 for the LIMIT value of SELECT statements if the value LIMIT is omited. Is it possible to query for all rows of a column family, regardless of how much rows will be returned? Or do I have to set the LIMIT value to an extremely high value to be sure to get all rows? Thx!
1
votes
2 Answers
6
votes
This is a common misconception. There is only a default 10000 row limit in cqlsh the interactive shell. The server and protocol do not have a default or maximum number of rows that can be returned. There is a timeout though which will stop running queries to protect users from running malformed queries which could cause system instability.
To get all the information from a table, the best tool is usually a separate analytics engine like spark. If the data is small enough you can just use paging which will return portions of the data in your query and not the whole thing at once. Pagination is supported by nearly all modern drivers. There is also work to add it to cqlsh which should be ready soon in the 2.1 branch.