Removing a value from a column
Let's say bob
decides he doesn't want his location on his profile. We'd like to get the location
column back to the state it was in earlier, which appears as null
in cqlsh
but simply means "no data here".
Missing columns in Cassandra
As we discussed previously, Cassandra doesn't have the concept of NULL
columns in the SQL sense. Concretely, 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 ...
Get Learning Apache Cassandra 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.