How to get list of tables in each Keyspace in Cassandra by using Cassandra Query Language ( CQL)
Keyspace is container/ namespace in which we create tables in Cassandra. You can think of Keyspace as Schema in Relational Database Management System. Sometime we need to get the list of tables in each Keyspace or get count of tables in each Keyspace.We can use system_schema.tables to get list of all tables with Keyspace names in which they exist.
CQLSH:techbrotherstutorials>SELECT keyspace_name,
table_name
FROM system_schema.tables;
table_name
FROM system_schema.tables;
I executed above query on Cassandra and got below results form my system.
Now if you are only interested to get the count of tables in each Keyspace, you can use below query.
CQLSH:techbrotherstutorials>SELECT Count(*) AS Table_Count,
keyspace_name
FROM system_schema.tables
GROUP BY keyspace_name;
keyspace_name
FROM system_schema.tables
GROUP BY keyspace_name;
The output of above query will be the count of tables in each keyspace in Cassandra.
Mua vé tại đại lý vé máy bay Aivivu, tham khảo
ReplyDeletegiá vé máy bay đi Mỹ khứ hồi
thông tin chuyến bay từ mỹ về việt nam
lịch bay từ canada về việt nam
é bay từ nhật về việt nam
đặt vé máy bay từ hàn quốc về việt nam
Vé máy bay từ Đài Loan về Việt Nam
danh sách khách sạn cách ly
vé máy bay chuyên gia sang Việt Nam