Counters and upserts

We'll also note that our earlier UPDATE statement attempted to increment a column in a row that did not yet exist. As we saw in Chapter 7, Expanding Your Data Model, this is an upsert operation; the UPDATE statement actually creates the row and increments the values accordingly. Not surprisingly, if we attempt to increment a counter column that doesn't yet have a value, its initial value is considered zero.

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.