user3765914
user3765914

Reputation: 51

How can I generate a UUID for use as a partition key using uuid() during insert and get the value generated back automatically?

I'm using Cassandra 2.0.9 and have modeled a table to use a uuid as a surrogate key for a table.

The DataStax driver I am using (ruby-driver) doesn't seem to have UUID generation on the client side, so I am currently using the uuid() function during insert. I want to get the value generated back immediately so I can use it in a manual inverted index.

Is this something I can do or would i have to find a workaround such as replacing it with a local uuid generator I have available in Ruby?

Upvotes: 0

Views: 154

Answers (1)

Adam Holmberg
Adam Holmberg

Reputation: 7365

You will not be able to get the uuid generated in CQL server-side. The ruby driver provides a UUID1 generator you can use to create UUIDs client-side.

Upvotes: 1

Related Questions