Defining static columns

To see how static columns work, we'll create a new table called users_with_status_updates. Our goal for this table is to contain both user profiles and users' status updates; however, we only want one copy of a user profile even though each user might have many status updates. To accomplish this, we'll add all of the columns from both users and user_status_updates to our new table, but we'll declare the user profile columns as STATIC:

CREATE TABLE "users_with_status_updates" (   "username" text,   "id" timeuuid,   "email" text STATIC,   "encrypted_password" blob STATIC,   "body" text,   PRIMARY KEY ("username", "id") );

Since the email and encrypted_password columns are properties of a user and not of a specific status ...

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.