incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tristan Seligmann <mithra...@mithrandi.net>
Subject Re: CQL3 Compound Primary Keys - Do I have the right idea?
Date Sun, 23 Dec 2012 22:54:52 GMT
On Sun, Dec 23, 2012 at 9:25 PM, aaron morton <aaron@thelastpickle.com> wrote:
> In this example:
>
>  CREATE TABLE seen_ships (
>        day text,
>        time_seen timestamp,
>        shipname text,
>        PRIMARY KEY (day, time_seen)
>    );
> http://www.datastax.com/dev/blog/whats-new-in-cql-3-0
>
> * day is the internal row key
> * there is only ONE internal column / cell, the shipname
> * the internal column / cell "shipname" is a composite of the *value* of
> time_seen. e.g. <time_seen:shipnae>

Alternatively, if you want a composite partition key eg.
<day:time_seen>, this functionality is implemented in
https://issues.apache.org/jira/browse/CASSANDRA-4179 and I believe is
available in Cassandra 1.2 as well[1].

[1] I recently asked about this on SO:
http://stackoverflow.com/questions/13938288/can-a-cassandra-cql3-column-family-have-a-composite-partition-key
--
mithrandi, i Ainil en-Balandor, a faer Ambar

Mime
View raw message