Static Columns

Master the concept of static columns in an Apache Cassandra table.

We'll cover the following...

Static columns

Recall the syntax for CREATE TABLE statement:

Press + to interact
CREATE TABLE [IF NOT EXISTS] [keyspaceName.]tableName (
column_name cql_type [ STATIC ] [, ...]
PRIMARY KEY (column_name [, column_name ...])
)
[ WITH table_options ] ;

Please refer to syntax conventions for CQL syntax notation details.

In Cassandra, a static column is defined by adding the STATIC keyword after the column data type, at the end of a column definition.

column_name cql_type STATIC

For example, the following line defines a static column titled profile_link:

 ...