How to list all column names in a column family in Cassandra?

Yelis913 picture Yelis913 · Jul 9, 2012 · Viewed 7.5k times · Source

I'm using Cassandra, and I want to make a data browser which shows the contents of any column family. I need to get the column names to configure a UI grid. Is it possible to collect the names of columns in all rows?

Answer

jbellis picture jbellis · Jul 9, 2012

The best way, if you are using Cassandra 1.1:

SELECT column_name FROM system.schema_columnfamilies WHERE keyspace_name = X AND columnfamily_name = Y

See also http://www.datastax.com/dev/blog/schema-in-cassandra-1-1