incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manu Zhang <owenzhang1...@gmail.com>
Subject Re: CQL3 Compound Primary Keys - Do I have the right idea?
Date Mon, 24 Dec 2012 13:17:32 GMT
>
> CREATE TABLE seen_ships (
>        day text,
>        time_seen timestamp,
>        shipname text,
>        PRIMARY KEY (day, time_seen)
>    );


In CQL3, we could select all the columns with the same 'day' and same
'time_seen'.

Is it possible with cassandra-cli?


On Mon, Dec 24, 2012 at 6:54 AM, Tristan Seligmann
<mithrandi@mithrandi.net>wrote:

> 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