How can I get list of all column families in keyspace in Cassandra using CQL 3?
22
votes
4 Answers
22
votes
38
votes
Or even more simply (if you are using cqlsh), switch over to your keyspace with use
and then execute describe tables
:
cqlsh> use products;
cqlsh:products> describe tables;
itemmaster itemhierarchy companyitemfavorites
testtable
Note: The describe command is specific to cqlsh only.
11
votes
CQL API supports both TABLES
and COLUMNFAMILIES
:
$ cqlsh
cqlsh> DESCRIBE KEYSPACES;
cqlsh> USE keyspace_shaharma;
see column families,
cqlsh:keyspace_shaharma> DESCRIBE COLUMNFAMILIES;
or
cqlsh:keyspace_shaharma> DESCRIBE TABLES;
2
votes
To list the column family or tables in the keyspace :
By using select Query:
SELECT table_name FROM system_schema.tables WHERE keyspace_name ='mydb';
By selecting Keyspace and then we can list the tables available inside the keyspace :
use keyspace_name describe tables;
By using Describe Keyword:
describe COLUMNFAMILIES;