Apache Cassandra 1.1 Documentation

DESCRIBE

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

Provides information about the connected Cassandra cluster, or about the data objects stored in the cluster.

Synopsis

DESCRIBE CLUSTER | SCHEMA
                 | KEYSPACE [<keyspace_name>]
                 | COLUMNFAMILIES
                 | COLUMNFAMILY <columnfamily_name>

Description

The DESCRIBE or DESC command outputs information about the connected Cassandra cluster, or about the data stored on it. In CQL3, you can query the system tables directly using SELECT. Use DESCRIBE in one of the following ways:

  • CLUSTER: Describes the Cassandra cluster, such as the cluster name, partitioner, and snitch configured for the cluster. When connected to a non-system keyspace, this form of the command also shows the data endpoint ranges owned by each node in the Cassandra ring.
  • SCHEMA: Lists CQL commands that you can use to recreate the column family schema. Works as though DESCRIBE KEYSPACE k was invoked for each keyspace k. May also show metadata about the column family.
  • KEYSPACE: Yields all the information that CQL is capable of representing about the keyspace. From this information, you can recreate the given keyspace and the column families in it. Omit the <keyspace_name> argument when using a non-system keyspace to get a description of the current keyspace.
  • COLUMNFAMILIES: Lists the names of all column families in the current keyspace or in all keyspaces if there is no current keyspace.
  • COLUMNFAMILY: Yields all the information that CQL is capable of representing about the column family.

To obtain additional information about the cluster schema, you can query system tables in CQL3.

Examples

DESCRIBE CLUSTER;

DESCRIBE KEYSPACE PortfolioDemo;

DESCRIBE COLUMNFAMILIES;

DESCRIBE COLUMNFAMILY Stocks;

CQL Commands

CQL Commands CQL Shell Commands
ALTER TABLE ASSUME
ALTER KEYSPACE CAPTURE
BATCH COPY
CREATE TABLE DESCRIBE
CREATE INDEX EXIT
CREATE KEYSPACE SHOW
DELETE SOURCE
DROP TABLE  
DROP INDEX  
DROP KEYSPACE  
INSERT  
SELECT  
TRUNCATE  
UPDATE  
USE