Apache Cassandra 1.0 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 various forms of the DESCRIBE or DESC command yield information about the currently connected Cassandra cluster and the data objects (keyspaces and column families) stored in the cluster:

  • 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. Release 1.0.8 and later.
  • COLUMNFAMILY: Yields all the information that CQL is capable of representing about the column family.

Examples

Describe a cluster

DESCRIBE CLUSTER;

Sample output is:

Cluster: Test Cluster
Partitioner: RandomPartitioner
Snitch: com.datastax.bdp.snitch.DseDelegateSnitch

Describe a keyspace

CREATE KEYSPACE Excelsior WITH strategy_class = 'SimpleStrategy'
 AND strategy_options:replication_factor = 1;

DESCRIBE KEYSPACE Excelsior;

Sample output is:

CREATE KEYSPACE Excelsior WITH strategy_class = 'SimpleStrategy'
 AND strategy_options:replication_factor = '1';

Describe a column family

Use Excelsior;

CREATE COLUMNFAMILY users (
   KEY uuid PRIMARY KEY,
   username text,
   email text )
   WITH comment='user information'
   AND read_repair_chance = 1.0;

DESCRIBE COLUMNFAMILY users;

Sample output is:

CREATE COLUMNFAMILY users (
  KEY uuid PRIMARY KEY,
  email text,
  username text
) WITH
  comment='user information' AND
  comparator=text AND
  read_repair_chance=1.000000 AND
  gc_grace_seconds=864000 AND
  default_validation=text AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write=True;