April 2017
Beginner to intermediate
360 pages
9h 35m
English
In the status updates we've created so far, we used predetermined UUIDs that were generated on May 29, 2014. For this reason, the timestamp encoded in the UUIDs doesn't really tell us anything useful about when the rows were created. However, in the general case, we would like to encode useful data in the UUID, and in particular, the timestamp at which the row itself was created.
Libraries that generate Version 1 UUIDs are available for just about any programming language, but Cassandra also gives us a built-in CQL function to generate a UUID from the current time, the NOW function. Let's use that function to insert a few new status updates:
INSERT INTO "user_status_updates" ("username", "id", "body") VALUES ...Read now
Unlock full access