CQL for Cassandra 2.x

Adding a collection to a table

The music service example includes the capability to tag the songs. From a relational standpoint, you can think of storage engine rows as partitions, within which (object) rows are clustered. To tag songs, use a collection set. Declare the collection set using the CREATE TABLE or ALTER TABLE statements. Because the playlists table already exists from the earlier example, just alter that table to add a collection set, tags:

ALTER TABLE playlists ADD tags set<text>;
Show/hide