axle_h
axle_h

Reputation: 565

Cassandra List Column Names

I'm storing photos in a list cql3 column. I can query the list easily from cql3 but I also need to understand how the Cassandra storage model deals with lists to be able to use the JMX bulkLoad service to get my data into Cassandra. If I insert some test data into a list like this:

insert into dat.lgr (id, photos) values (0, [0xaa, 0xbb]);

The resulting data, when queried with the cli looks like this:

=> (column=photos:2fce75c0fe9811e2ab248b7126053a99, value=aa, timestamp=1375794036508000)
=> (column=photos:2fce75c1fe9811e2ab248b7126053a99, value=bb, timestamp=1375794036508000)

So it looks like Cassandra is actually storing a column for each element in the list, identified by a composite column name consisting of the collection name and an unknown hex number. The number is likely a 64 bit hash, or two 32 bit hashes appended together. But what's been hashed? I've looked through the source code but found nothing. Any help appreciated.

Upvotes: 0

Views: 297

Answers (1)

Wildfire
Wildfire

Reputation: 6418

I'd suggest that column names for list items are UUIDs. At least both these values represent valid date "Tuesday, August 6, 2013 1:00:36 PM GMT" (try ""2fce75c0-fe98-11e2-ab24-8b7126053a99" in http://www.famkruithof.net/uuid/uuidgen for example).

It's easy to verify - just truncate the table and repeat the same statement. You would get completely different column names for the same data if my guess is correct.

Upvotes: 2

Related Questions