2014-03-29 33 views

回答

21
cqlsh> select columnfamily_name from system.schema_columnfamilies where keyspace_name = 'test'; 

columnfamily_name 
------------------- 
      commits 
       foo 
    has_all_types 
     item_by_user 
       test 
      test2 
     user_by_item 

(7 rows) 
+5

作爲卡桑德拉3.0,這應該是:'SELECT TABLE_NAME FROM system_schema .tables WHERE keyspace_name ='test';' – etienne

33

甚至更​​簡單(如果你使用cqlsh),切換到你的密鑰空間與use,然後執行describe tables

cqlsh> use products; 
cqlsh:products> describe tables; 

itemmaster itemhierarchy   companyitemfavorites 
testtable 

注:describe命令專用只cqlsh。

11

CQL API支持TABLESCOLUMNFAMILIES

$ cqlsh 
cqlsh> DESCRIBE KEYSPACES; 
cqlsh> USE keyspace_shaharma; 

看到列族,

cqlsh:keyspace_shaharma> DESCRIBE COLUMNFAMILIES; 

cqlsh:keyspace_shaharma> DESCRIBE TABLES;