Provides information about the connected Cassandra cluster, or about the data objects stored in the cluster.
DESCRIBE CLUSTER | SCHEMA | KEYSPACES | KEYSPACE keyspace_name | TABLES | TABLE table_name
In the synopsis section of each statement, formatting has the following meaning:
- Uppercase means literal
- Lowercase means not literal
- Italics mean optional
- The pipe (|) symbol means OR or AND/OR
- Ellipsis (...) means repeatable
- « means a non-literal, open parenthesis used to indicate scope
- » means a non-literal, close parenthesis used to indicate scope
A semicolon that terminates CQL statements is not included in the synopsis.
The DESCRIBE or DESC command outputs information about the connected Cassandra cluster, or about the data stored on it. To query the system tables directly, use SELECT.
The keyspace and table name arguments are case-sensitive and need to match the upper or lowercase names stored internally. Use the DESCRIBE commands to list objects by their internal names.
DESCRIBE functions in the following ways:
- DESCRIBE CLUSTER
Output is the information about the connected Cassandra cluster, such as the cluster name, and the partitioner and snitch in use. When you are connected to a non-system keyspace, this command also shows endpoint-range ownership information for the Cassandra ring.
- DESCRIBE SCHEMA
Output is a list of CQL commands that could be used to recreate the entire schema. Works as though DESCRIBE KEYSPACE <k> was invoked for each keyspace k.
- DESCRIBE KEYSPACES
Output is a list of all keyspace names.
- DESCRIBE KEYSPACE keyspace_name
Output is a list of CQL commands that could be used to recreate the given keyspace, and the tables in it. In some cases, as the CQL interface matures, there will be some metadata about a keyspace that is not representable with CQL. That metadata will not be shown.
The <keyspacename> argument can be omitted when using a non-system keyspace; in that case, the current keyspace is described.
- DESCRIBE TABLES
Output is a list of the names of all tables in the current keyspace, or in all keyspaces if there is no current keyspace.
- DESCRIBE TABLE table_name
Output is a list of CQL commands that could be used to recreate the given table. In some cases, there might be table metadata that is not representable and it is not shown.
DESCRIBE CLUSTER; DESCRIBE KEYSPACES; DESCRIBE KEYSPACE PortfolioDemo; DESCRIBE TABLES; DESCRIBE TABLE Stocks;