In this article, we will cover a simple but practical command that allows you to fetch such information from the CQLSH session.
CQLSH Show Command
The show command allows you to show various information depending on the subsequent sub-command.
The command syntax is shown below:
The command supports the following sub-commands:
- VERSION – This shows version information for various resources, such as CQLSH, the database, native protocol, and the CQL specification
- HOST – Shows node details for the session host
- SESSION traccing_session_id – this option returns detailed information about the specific query in the tracing_session_id. Cassandra will store the session IDs in the system_traces.sessions tables
Example Command Usage
The following examples depict how to use the show command and the resulting output:
Log in to Cassandra:
To show the version information, run the following command:
Output:
To show host information, run the following command:
Example output:
Show trace activity for a given session ID:
The command should return tracing information for the session as shown in the sample output below:
You can get your session information from the sessions table, as shown below:
Example output:
Conclusion
This brief tutorial covered one of the CQLSH commands that allows us to fetch various information from the CQLSH session. The CQLSH Show command supports various sub-commands, such as Version and Host.