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

gmldba_107428 avatar image
gmldba_107428 asked ·

How can I get a row count? SELECT COUNT(*) returns ReadTimeout error

I am trying to do a select count(*) from keyspace.table; (is a dev environment). I am getting the following error:
ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

How can I get a row count on a table?

countquery
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.

dave.bechberger avatar image
dave.bechberger answered ·

There are several ways you can get a count on a table such as using the driver to count by token range or using DSE Analytics but I would suggest that the easiest way is likely to use the DataStax Bulk Loader known as dsbulk. One of the features available in dsbulk is being able to perform a count operation on a table. There was a good blog post on this a little while back which you can see here:


DataStax Bulk Loader - Counting

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.

Is this application free to use commercially?

0 Likes 0 · ·
Erick Ramirez avatar image
Erick Ramirez answered ·

@gmldba_107428 you will need a current DataStax subscription to use DSBulk on DataStax Enterprise (DSE) or DataStax Distribution of Apache Cassandra (DDAC) clusters. Cheers!

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.