cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vivek Mishra <mishra.v...@gmail.com>
Subject ORDER by support over clustered column of primary key.
Date Tue, 09 Oct 2012 09:54:36 GMT
Hi,

Create a column family:
------------------------------------

CREATE TABLE altercations (
       instigator text,
       started_at timestamp,
       ships_destroyed int,
       energy_used float,
       alliance_involvement boolean,
       PRIMARY KEY (instigator,started_at,ships_destroyed);

I think "instigator" is part of primary compound key.

Insert :
---------

   INSERT INTO altercations (instigator, started_at, ships_destroyed,
                             energy_used, alliance_involvement)
                     VALUES ('Jayne Cobb', '2012-07-24', 2, 4.6, 'false');




Select:

SELECT * FROM altercations
          WHERE instigator='Jayne Cobb' ORDER BY started_at;

It works. But when i try:

SELECT * FROM altercations
          WHERE instigator='Jayne Cobb' ORDER BY instigator;

It gives me:

{Bad Request: Order by is currently only supported on the clustered columns
of the PRIMARY KEY, got instigator}


Any idea, what am i missing?

-Vivek

Mime
View raw message