Nipun
Nipun

Reputation: 4319

cassandra cqlsh giving wrong counts

I have a table in cassandra with only 2 columns and 16 rows. When I do a

select * from <table name>

I can see only 15 rows. When I do a

select count(*) from <table name> 

I get count as 15 I am writing these queries in cqlsh There is 1 row missing, but if I do something like select * from where appname = '' I get the row.

When I am doing the samething using nodejs casandra driver I get the right result as 16. what can be the issue here. I did nodetool flush as well but same result I am using cassandra 2.18

Upvotes: 2

Views: 1791

Answers (1)

Adrien Piquerez
Adrien Piquerez

Reputation: 1044

It could be a problem of consistency level. The read consistency level to use depends on the replication factor and the write consistency level.

You can find more information about consistency level on datastax documentation.

To quickly resolve your issue, you can try this on cqlsh :

CONSISTENCY ALL
SELECT count(*) ON <table name>

Upvotes: 8

Related Questions