Skip to Content
Mastering Apache Cassandra 3.x - Third Edition
book

Mastering Apache Cassandra 3.x - Third Edition

by Aaron Ploetz, Tejaswi Malepati
October 2018
Beginner to intermediate content levelBeginner to intermediate
348 pages
10h
English
Packt Publishing
Content preview from Mastering Apache Cassandra 3.x - Third Edition

STATIC

Static columns are data that is more dependent on the partition keys than on the clustering keys. Specifying a column as STATIC ensures that its values are only stored once (with its partition keys) and not needlessly repeated in storage with the row data.

A new table can be created with a STATIC column like this:

CREATE TABLE packt_ch3.fighter_jets ( type TEXT PRIMARY KEY, nickname TEXT STATIC, serial_number BIGINT);

Likewise, an existing table can be altered to contain a STATIC column:

ALTER TABLE packt_ch3.users_by_dept ADD department_head TEXT STATIC;

Now, we can update data in that column:

INSERT INTO packt_ch3.users_by_dept (department,department_head) VALUES('Engineering','Richard');INSERT INTO packt_ch3.users_by_dept (department,department_head) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

Nishant Neeraj

Publisher Resources

ISBN: 9781789131499Supplemental Content