Book Image

Mastering Apache Cassandra - Second Edition

Book Image

Mastering Apache Cassandra - Second Edition

Overview of this book

Table of Contents (15 chapters)
Mastering Apache Cassandra Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

CQL shell commands


CQL shell or cqlsh comes with many little utilities. In this section, we will see them.

DESCRIBE

The DESCRIBE command is used to get details of container objects. You can use DESC in place of DESCRIBE. So, one can describe a keyspace, table, or cluster. There are five variants of this command:

# Describe the whole cluster
DESCRIBE CLUSTER
# Display the CQL command to regenerate all the keyspaces in the cluster
DESCRIBE SCHEMA
# List all the keyspaces names
DESCRIBE KEYSPACES
# List the CQL statement that can be used to recreate the keyspace
DESCRIBE KEYSPACE <keyspace_name>
# Show tables names in the current keyspace
# Show all the tables across all the keyspaces if not using any keyspace
DESCRIBE TABLES
# Print CQL to create a table
DESCRIBE TABLE <table_name>
TRACING

The TRACING command is a convenient tool to view the steps that your queries go through and possibly use it to optimize the query. It displays how much time is spent on what step at which node.

Use...