I'm inserting some data into a Cassandra table(/column family), and I need to generate a unique key. I've decided to use timeuuid
for this, as it gives me nice sortability as well as uniqueness. I can use the now()
function to generate the timeuuid, as in this CQL code:
insert into uuidtest ( something, else ) values ( now(), 'hola' );
The problem with this technique is that I have no idea what value I just inserted. I need to know this, as I'm going to need to use it later.
How can I retrieve this value at the time that I insert it (as I certainly can't guarantee that nobody else will insert one immediately after me)?