I'm trying to explore the database and want to see all tables that exist there. What's the command that's equivalent to SHOW TABLES;
in SQL?
To list all the tables (only the table names), DESC tables; To list all the tables and the schemas (CQL creation statements), DESC {$KEYSPACE_NAME} whereas {$KEYSPACE_NAME} is the name of the keyspace.
Go to data tab > there you will see all keyspcaces created by you and some system keyspaces. You can see all tables under individual keyspaces and also replicator factor for keyspace.
DESCRIBE TABLES Output the names of all tables in the current keyspace, or in all keyspaces if there is no current keyspace. DESCRIBE TABLE [.] Output CQL commands that could be used to recreate the given table. In some cases, as above, there may be table metadata which is not representable and which will not be shown.
Cassandra provides fine-grained control of table storage on disk. On packaged installations, the data files are stored in the same format, but in /var/lib/cassandra/data by default.
Depending on the version of Cassandra, the following may work for you
SELECT * FROM system_schema.tables
Check out the other tables in the system_schema keyspace to see what other info you can get
to get all table names : DESC tables;
to get detailed view of a table : DESC table <table_name>;
to get detailed view of all tables in a keyspace : DESC keyspace <keyspace_name>;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With