I created a simple tabe:
CREATE TABLE test (
"type" varchar,
"value" varchar,
PRIMARY KEY(type,value)
);
I inserted 5 rows into it:
INSERT INTO test(type,value) VALUES('test','tag1')
INSERT INTO test(type,value) VALUES('test','tag2')
INSERT INTO test(type,value) VALUES('test','tag3')
INSERT INTO test(type,value) VALUES('test','tag4')
INSERT INTO test(type,value) VALUES('test','tag5')
I ran SELECT * from test LIMIT 3
and it works as expected.
type | value
------+------
test | tag1
test | tag2
test | tag3
When I ran SELECT COUNT(*) from test LIMIT 3
, it produces:
count
-------
5
Shouldn't it say 3?
The Datastax documentation seems to suggest that specifying a LIMIT
will overwrite the default of 10,000. Why does it not work in this case? If it matters, I'm on Cassandra 2.2.5 and ran all the queries through cqlsh.
Update
Both the Java driver and CQLSH have been tested to show that LIMIT
indeed does not work as prescribed in the documentation. If there are any Datastax employees reading, your input would be greatly appreciated.