06 CassandraDB Comman
06 CassandraDB Comman
Tushar B. Kute,
http://tusharkute.com
Shell Commands
• help
– The HELP command displays a synopsis and a
brief description of all cqlsh commands.
• capture
– This command captures the output of a
command and adds it to a file.
• CONSISTENCY
– This command shows the current consistency
level, or sets a new consistency level.
Shell Commands
• Copy
– This command copies data to and from Cassandra to a file. Given
below is an example to copy the table named emp to the file myfile.
– COPY emp (emp_id, emp_city, emp_name, emp_phone, emp_sal)
TO ‘myfile’;
• DESCRIBE
– This command describes the current cluster of Cassandra and its
objects. The variants of this command are explained below.
– Describe cluster: This command provides information about the
cluster.
– Describe Keyspaces: This command lists all the keyspaces in a
cluster.
– Describe tables: This command lists all the tables in a keyspace.
Shell Commands
• Expand
– This command is used to expand the output. Before using
this command, you have to turn the expand command on.
• SHOW
– This command displays the details of current cqlsh session
such as Cassandra version, host, or data type assumptions.
– show host;
– show version;
• SOURCE
– Using this command, you can execute the commands in a
file.
KeySpace operations
• Example:
– DROP KEYSPACE tushar;
Create table