Tuesday, 24 July 2018

10 Cassandra Documented Shell Commands | CQL Shell Commands


10 Cassandra Documented Shell Commands | CQL Shell Commands

1. Objective

In the last Cassandra tutorial, we studied Cassandra Data Models, now we are going to learn about top 10 Cassandra Documented Shell Commands or CQL Shell commands: help, capture, copy, describe, expand, show, tracing, paging, source, and exit with syntax.
So, let’s explore Cassandra Documented Shell Commands.
10 Cassandra Documented Shell Commands | CQL Shell Commands
10 Cassandra Documented Shell Commands | CQL Shell Commands

2. Cassandra Documented Shell Commands

There are many documented shell commands in Cassandra. Cassandra Documented Shell commands help the user to get documentation on the topic. These documents help the user to know and troubleshoot their query. Apart from this, these are simple commands used to do some specific tasks. There are many documented shell commands in CQLSH. They are:

a. Help

Help command allows the user to access help for all the other commands. In other words, it describes and explains all the other cqlsh commands. When this command is executed, a bunch of topics is displayed in a window. This contains a description and helps for all cqlsh commands.
A Syntax of Help Command-
  1. cqlsh:keyspace>HELP
b. Capture
There may be times when a user wants to store the output in a file. Capture command lets the user do so. It allows the latest output of a command to be captured, and then this captured output is then added to a new file.
A Syntax of Capture Command-
  1. cqlsh:keyspace>CAPTURE

c. Consistency

When consistency command is executed the user gets the information about the consistency level. A user can know current consistency level. Apart from this, a user can also set a new consistency.
A Syntax of Consistency Command-
  1. cqlsh:keyspace> CONSISTENCY

d. Copy

The user may sometimes want to copy data. This Copy Command lets the user to either copy data from Cassandra to other files. Apart from this, it also allows the user to copy data from other places to Cassandra.
A Syntax of Copy Command-
  1. cqlsh:keyspace> COPY

e. Describe

Describe Command is widely used for verification. A user can verify all the data using this command. Along with proper syntax, this command displays the data stored in the data types. These data types can be collection data type or user-defined data type or simple data type as well. This command describes the cluster of Cassandra and its objects.
A Syntax of Describe Command-
  1. cqlsh:keyspace> DESCRIBE
f. Expand
This command expands the output. After the execution of the command, the output of the query is expanded vertically. Using Expand command, the user can look into the details of the output.
A Syntax of Expand Command-
  1. cqlsh:keyspace> EXPAND

g. Show

There are a lot of details or description about Cassandra or cqlsh. Show command helps the user to display such details. These details include Cassandra version, host, data type assumption etc.
A Syntax of Show Command-
  1. cqlsh:keyspace> SHOW

h. Tracing

This is a simple command which user uses to enable or disable request tracing.
A Syntax of Tracing Command-
  1. cqlsh:keyspace> TRACING

i. Paging

This is a simple command which user uses to enable or disable query paging.
A Syntax of Paging Command-
  1. cqlsh:keyspace> PAGING

j. Source

Source command allows the user to execute source files. These files contain CQL statements. Using this command, the user automatically connects the cqlsh with the file. After this connection, the file is automatically executed.
A Syntax of Source Command-
  1. cqlsh:keyspace> SOURCE
k. Exit
This is a simple command that terminates cqlsh. In other words, this commands exits the user from the window.
A Syntax of Exit Command-
  1. cqlsh:keyspace> EXIT
So, this was all about Cassandra Documented Shell Commands Tutorial. Hope you like our explanation.

3. Conclusion

Hence, In this Cassandra Documented Shell Commands tutorial, we got to know about the CQLSH Commands: Exit Command, Source Command, Paging Command, Tracing Command, Show-Command, Expand Command, Describe Command, Copy Command, Consistency Command, Capture Command, and Help Command with syntax. Furthermore, if you have any query regarding Cassandra Documented Shell Commands, Feel free to ask in the comment section. 

0 comments:

Post a Comment