Secondary indexes on map columns

We just created a secondary index on a set column, which allows us to retrieve rows that contain a given value in that set. Secondary indexes on list columns work in precisely the same way. However, map columns have both keys and values, so it's not immediately obvious what data populates the index.

By default, a secondary index on a map will index the values in the map; the CONTAINS keyword similarly filters for map values. However, it is possible to create an index on map keys as well and then select rows with a given key in a map column.

Let's say we'd like to look up users for whom we have an associated Twitter identity. Recall that in the social_identities column of the users table, the map keys are the ...

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.