Details
-
Task
-
Status: Resolved
-
Low
-
Resolution: Invalid
-
None
-
None
-
CentOS 6.6
[cqlsh 5.0.1 | Cassandra 2.2.5 | CQL spec 3.3.1 | Native protocol v4]
Description
Cassandra 2.1 allowed you to LIMIT a COUNT and have it mean that the query would return as soon as it found enough rows to fulfill your limit.
For example,
SELECT COUNT(*) FROM some_table LIMIT 1
would always return a count of 1 as long as there is at least one row in the table.
I've noticed that Cassandra 2.2 no longer behaves in this way and yet the documentation continues to suggest otherwise:
http://docs.datastax.com/en/cql/3.3/cql/cql_reference/select_r.html?scroll=reference_ds_d35_v2q_xj__specifying-rows-returned-using-limit
Cassandra 2.2 seems to return the full count despite what you set the LIMIT to.
Looking through the version changes, it seems likely that the changes for the following note might be related (from https://docs.datastax.com/en/cassandra/2.2/cassandra/features.html):
Allow count(*) and count(1) to be use as normal aggregation count() can now be used in aggregation.
If so, the related ticket seems to be https://issues.apache.org/jira/browse/CASSANDRA-10114.