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 C18F3DC08 for ; Mon, 22 Oct 2012 13:45:40 +0000 (UTC) Received: (qmail 79426 invoked by uid 500); 22 Oct 2012 13:45:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 79403 invoked by uid 500); 22 Oct 2012 13:45:38 -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 79387 invoked by uid 99); 22 Oct 2012 13:45:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 13:45:37 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [143.112.68.15] (HELO mckesson.com) (143.112.68.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 13:45:31 +0000 Received: from ([10.122.55.77]) by ndhaxpcsm03.mckesson.com with ESMTP with TLS id 7N3MQH1.334580498; Mon, 22 Oct 2012 09:45:07 -0400 Received: from NDHEP50008.na.corp.mckesson.com (10.122.55.55) by NDHEP50135.na.corp.mckesson.com (10.122.55.77) with Microsoft SMTP Server (TLS) id 14.1.339.1; Mon, 22 Oct 2012 09:45:07 -0400 Received: from NDHEP50005.na.corp.mckesson.com ([fe80::853b:6614:c21b:a15f]) by NDHEP50008.na.corp.mckesson.com ([::1]) with mapi id 14.01.0339.001; Mon, 22 Oct 2012 09:45:06 -0400 From: "Ryabin, Thomas" To: "user@cassandra.apache.org" Subject: RE: DELETE query failing in CQL 3.0 Thread-Topic: DELETE query failing in CQL 3.0 Thread-Index: AQHNsBZ3b6yevJ+dSVeZm8HIuzg5O5fFVkfA Date: Mon, 22 Oct 2012 13:45:05 +0000 Message-ID: <45206234D3584F47B7ADCEA7B2EDC30931815C0C@NDHEP50005.na.corp.mckesson.com> References: <45206234D3584F47B7ADCEA7B2EDC30931815864@NDHEP50005.na.corp.mckesson.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.102.48.180] Content-Type: multipart/alternative; boundary="_000_45206234D3584F47B7ADCEA7B2EDC30931815C0CNDHEP50005nacor_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_45206234D3584F47B7ADCEA7B2EDC30931815C0CNDHEP50005nacor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I figured out the problem. The DELETE query only works if the column used i= n the WHERE clause is also the first column used to define the PRIMARY KEY. -Thomas From: wang liang [mailto:wlahhn@gmail.com] Sent: Monday, October 22, 2012 1:31 AM To: user@cassandra.apache.org Subject: Re: DELETE query failing in CQL 3.0 It is better to provide table definition. I guess the reason is below state= ment. " a table must define at least one column that is not part of the PRIMARY K= EY as a row exists in Cassandra only if it contains at least one value for = one such column " Please check this document here. On Mon, Oct 22, 2012 at 7:53 AM, aaron morton > wrote: Can you paste the table definition ? Thanks ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 20/10/2012, at 5:53 AM, "Ryabin, Thomas" > wrote: I have a column family called "books", and am trying to delete all rows whe= re the "title" column is equal to "hatchet". This is the query I am using: DELETE FROM books WHERE title =3D 'hatchet'; This query is failing with this error: Bad Request: PRIMARY KEY part title found in SET part I am using Cassandra 1.1 and CQL 3.0. What could be the problem? -Thomas -- Best wishes, Helping others is to help myself. --_000_45206234D3584F47B7ADCEA7B2EDC30931815C0CNDHEP50005nacor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I figured out the problem= . The DELETE query only works if the column used in the WHERE clause is als= o the first column used to define the PRIMARY KEY.

 <= /p>

-Thomas=

 <= /p>

From: wang lia= ng [mailto:wlahhn@gmail.com]
Sent: Monday, October 22, 2012 1:31 AM
To: user@cassandra.apache.org
Subject: Re: DELETE query failing in CQL 3.0

 

It is better to provide table definition. I gue= ss the reason is below statement. 

" a table must define at least one column that is not part of the PRIMAR= Y KEY as a row exists in Cassandra only if it contains at least one value f= or one such column "

Please check this document here

 

On Mon, Oct 22, 2012 at 7:53 AM, aaron morton <aaron@thelastpic= kle.com> wrote:

Can you paste the table definition ? 

 

Thanks

 

-----------------

Aaron Morton

Freelance Developer=

@aaronmorton

 

On 20/10/2012, at 5:53 AM, "Ryabin, Thomas"= ; <Thoma= s.Ryabin@McKesson.com> wrote:



I have a column family called “bo= oks”, and am trying to delete all rows where the “title” = column is equal to “hatchet”. This is the query I am using:

    DELETE FROM books WH= ERE title =3D ‘hatchet’;

 

This query is failing with this error:<= o:p>

    Bad Request: PR= IMARY KEY part title found in SET part

 

I am using Cassandra 1.1 and CQL 3.0. W= hat could be the problem?

 

-Thomas

 



 

--
Best wishes,
Helping others is to help myself.

--_000_45206234D3584F47B7ADCEA7B2EDC30931815C0CNDHEP50005nacor_--