Check column existence
Using cqlsh
, you can either get the description of all columns and their data types, or discover whether a particular column exists in a table by querying the column’s data.
All columns
The CQLSH command DESCRIBE TABLE
shows all the table information, including the columns defined.
For example, if the cycling.comments
table is defined, the following will return the table definition:
DESCRIBE TABLE cycling.comments;
Results
Particular column
If a column exists, a SELECT
command will return any data stored in the column:
SELECT * FROM cycling.upcoming_calendar WHERE year = 2015 AND month = 6;
Results
See also: