Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9DACED235 for ; Tue, 9 Oct 2012 09:55:11 +0000 (UTC) Received: (qmail 72965 invoked by uid 500); 9 Oct 2012 09:55:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 72607 invoked by uid 500); 9 Oct 2012 09:55:07 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 72564 invoked by uid 99); 9 Oct 2012 09:55:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 09:55:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mishra.vivs@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pb0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 09:54:57 +0000 Received: by mail-pb0-f44.google.com with SMTP id ro8so5069910pbb.31 for ; Tue, 09 Oct 2012 02:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tsIIhhxJuy0GnEUYMlkfoG0c/DCE0OU41DzOgkYvgr0=; b=KD+tE28/vCZHagM8W8QCvtGHXTArL3DaEO7AYtqQgOPXP9hIRxo+e3AwXa45KSBjK8 fCAgTq5C1thRYsHGlfQXWoe+VdRFx3Acz0OyL/Rlh8IZk6YkYDrntaOKUcR5msJSyIq1 edITsySf21VTH5SZ30SPXfO7l96b/AG/HAMWsHjluSDeZY60X2pHrV+lb0MUA/7Nn9sW aOI9rVZhEdjinKAGD97RFPsfe+jDfgIr94jkl5X7fDhVs8P8qCWl1zTCIzDVZH4Q2OU/ Ey5blkvXxzP2I1/2tXqwZM8SIzY78mye3LNP4jQ2grU/MfehaIHEKL0MYgl2O38ZKhu9 z9Lw== MIME-Version: 1.0 Received: by 10.68.232.70 with SMTP id tm6mr61958854pbc.104.1349776476435; Tue, 09 Oct 2012 02:54:36 -0700 (PDT) Received: by 10.66.10.71 with HTTP; Tue, 9 Oct 2012 02:54:36 -0700 (PDT) Date: Tue, 9 Oct 2012 15:24:36 +0530 Message-ID: Subject: ORDER by support over clustered column of primary key. From: Vivek Mishra To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b33d9366775d604cb9d53a4 --047d7b33d9366775d604cb9d53a4 Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b33d9366775d604cb9d53a4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

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

CREATE TABLE al= tercations (
=A0 =A0 =A0 =A0instigator text,
=A0 =A0 = =A0 =A0started_at timestamp,
=A0 =A0 =A0 =A0ships_destroyed int,
=A0 =A0 =A0 =A0energy_us= ed float,
=A0 =A0 =A0 =A0alliance_involvement boolean,
= =A0 =A0 =A0 =A0PRIMARY KEY (instigator,started_at,ships_destroyed);

I think "instigator" is part of primary c= ompound key.=A0

Insert :
---------

<= div>=A0 =A0INSERT INTO altercations (instigator, started_at, ships_destroye= d,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ene= rgy_used, alliance_involvement)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VALUES ('Jayne Cobb'= ;, '2012-07-24', 2, 4.6, 'false');




Select:

<= /div>
SELECT * FROM altercations
=A0 =A0 =A0 =A0 =A0 WHERE instigator=3D'Jayne Cobb' ORDER BY s= tarted_at;

It works. But when i try:

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

It gives me:

{Bad R= equest: Order by is currently only supported on the clustered columns of th= e PRIMARY KEY, got instigator}


Any idea, what am i missing?

-Vivek

--047d7b33d9366775d604cb9d53a4--