This blog is primarily focus on Java fundamentals and the libraries built on top of Java programming language. Most of the post are example oriented, hope you have fun in reading my blog....:)
Showing posts with label keyspace. Show all posts
Showing posts with label keyspace. Show all posts
Thursday, 13 February 2020
Wednesday, 22 January 2020
Cassnadra: List all tables in a keyspace
‘DESCRIBE TABLES’ or ‘DESC
TABLES’ command is used to list all tables in a keyspace.
Previous
Next
Homecqlsh> DESC KEYSPACES;
system_schema system system_distributed
system_auth cassandratutorial system_traces
cqlsh>
cqlsh> USE system;
cqlsh:system>
cqlsh:system> DESC TABLES;
available_ranges peers batchlog transferred_ranges
batches compaction_history size_estimates hints
prepared_statements sstable_activity built_views
"IndexInfo" peer_events range_xfers
views_builds_in_progress paxos local
Sunday, 12 January 2020
Cassandra: Drop keyspace if it exists
If you are
trying to drop a keyspace, that is not exists, you will get an error like ConfigurationException: Cannot drop non
existing keyspace 'cassandratutorial'.
Use the
command ‘DROP KEYSPACE IF EXISTS’ to drop the keyspace only if it exist. This command deletes
the keyspace, if it exists only, else it ignore.
Syntax
DROP
KEYSPACE IF EXISTS keyspace_name
Example
DROP
KEYSPACE IF EXISTS cassandratutorial;
Cassandra: Drop or delete keyspace
You can
use 'DROP KEYSPACE' command to drop a keyspace. Once you execute the 'DROP
KEYSPACE' command, it removes everything (including tables, functions, data in
the keyspace).
Syntax
DROP
KEYSPACE [IF EXISTS] keyspace_name
What if you are trying to drop a
keyspace, which is not existed anymore?
You will
get an error like 'ConfigurationException: Cannot drop non existing keyspace
'cassandratutorial'.
cqlsh> DROP KEYSPACE cassandratutorial;
ConfigurationException: Cannot drop non existing keyspace 'cassandratutorial'.
Subscribe to:
Posts (Atom)