Static Columns
Explore how static columns function in Apache Cassandra to store data shared across all rows within a partition. Understand their syntax, use cases, and constraints, including how to add static columns, insert and update their data, and query them effectively. This lesson helps you optimize table design and storage in Cassandra, especially for tables with multiple clustering columns.
We'll cover the following...
We'll cover the following...
Static columns
Recall the syntax for CREATE TABLE statement:
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:
profile_link text STATIC
Static columns ...