Viewing a table schema in cqlsh

In this chapter, we'll be working with the users table, which we haven't had much interaction with since the early chapters. Before we start making changes to the users table, it would be helpful to have a reminder of what its schema looks like.

One option would be to simply issue a SELECT statement and look at the row headers; however, cqlsh gives us a more elegant way to view the schema, namely the DESCRIBE TABLE statement:

DESCRIBE TABLE "users"; 

The output is a CREATE TABLE statement showing the table's schema, as well as all properties for the table:

The part of the output beginning with WITH tells us ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.