Counting data example

You can use the dsbulk count command to return information about the data in database tables.

Databases supported by DataStax Bulk Loader

DataStax Bulk Loader® supports the use of the dsbulk load, dsbulk unload, and dsbulk count commands with:

  • DataStax Astra DB

  • DataStax Enterprise (DSE) 5.1 and 6.8 databases

  • Open source Apache Cassandra® 2.1 and later databases

dsbulk count example

The following command returns information about the partition data used in the cycling.comments table. The results are organized as follows:

  1. Left column: partition key value

  2. Middle column: number of rows using that partition key value

  3. Right column: the partition’s percentage of rows compared to the total number of rows that were scanned for this query

dsbulk count -k cycling -t comments --stats.modes partitions --stats.numPartitions 50
                Operation directory: /home/automaton/cycling/logs/COUNT_20190424-213840-954894
                total | failed | rows/s | mb/s | kb/row | p50ms | p99ms | p999ms
                   31 |      0 |     74 | 0.00 |   0.02 | 27.59 | 31.33 |  31.33
                   Operation COUNT_20190424-213840-954894 completed successfully in 2 seconds.
                   fb372533-eb95-4bb4-8685-6ef61e994caa 5 16.13
                   8566eb59-07df-43b1-a21b-666a3c08c08a 4 12.90
                   c7fceba0-c141-4207-9494-a29f9809de6f 4 12.90
                   e7ae5cf3-d358-4d99-b900-85902fda9bb0 4 12.90
                   6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47 3 9.68
                   9011d3be-d35c-4a8d-83f7-a3c543789ee7 2 6.45
                   95addc4c-459e-4ed7-b4b5-472f19a67995 2 6.45
                   38ab64b6-26cc-4de9-ab28-c257cf011659 2 6.45
                   5b6962dd-3f90-4c93-8f61-eabfa4a803e2 1 3.23
                   c4b65263-fe58-4846-83e8-f0e1c13d518f 1 3.23
                   e7cd5752-bc0d-4157-a80f-7523add8dbcd 1 3.23
                   6d5f1663-89c0-45fc-8cfd-60a373b01622 1 3.23
                   220844bf-4860-49d6-9a4b-6b5d3a79cbfb 1 3.23

Additional options are provided with the dsbulk count command. Refer to Count options.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com