Missing columns in Cassandra

As we discussed previously, Cassandra doesn't have the concept of NULL columns in the SQL sense. Technically, the following statement is not possible in Cassandra:

SELECT * FROM "users" WHERE "location" IS NULL; 

Relational databases typically store a separate bit in each column to indicate whether that column contains a NULL value. In Cassandra, on the other hand, all data columns are optional, and only the columns with a value are represented in storage. We can visualize Cassandra rows as maps of key-value pairs, with some keys possibly missing; relational database rows are more like fixed-size lists of columns, where some columns may have a NULL value. The following diagram shows how we might visualize 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.