Cassandra: get column names of a columnfamily?

user2090879 picture user2090879 · Apr 17, 2013 · Viewed 14.1k times · Source

I'm wondering if there is a query in CQL3 that allows you to get column names of a specific columnfamily that has a static schema?
Thanks in advance :)

Answer

abhi picture abhi · Apr 17, 2013

If you want to get column names of a specific table with CQL3 then i guess try this

select * from system.schema_columns WHERE keyspace_name='#KS' AND columnfamily_name='#CF' allow filtering;

Note: keyspace_name in the where clause is optional. Its mainly used for better filtration purpose (say, table with the same name in multiple keyspace)