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 956A0DCBD for ; Mon, 22 Oct 2012 22:16:16 +0000 (UTC) Received: (qmail 83895 invoked by uid 500); 22 Oct 2012 22:16:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 83873 invoked by uid 500); 22 Oct 2012 22:16:13 -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 83862 invoked by uid 99); 22 Oct 2012 22:16:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 22:16:13 +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 (athena.apache.org: domain of tyler@datastax.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 22:16:09 +0000 Received: by mail-vc0-f172.google.com with SMTP id fl11so3875388vcb.31 for ; Mon, 22 Oct 2012 15:15:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=L0pO04dSTTDUsq+yJiPx7FedgaYrGVIu5ULZtLgX66M=; b=m+3aSfkxXzMOV+kpwSVap++uH+bHuRA2RTjODhsQlIvnVTqy3pd6srgET5C/hdNbsW qRm/c9chDUZyGPGoFCQB09+VE3n8GnTdRzKRXs8ZappJYcMemEVDALzhMi6cP5tMJhlO /g9tdu+hW0nRfFpDU86MJZ8hMvOfP7uVSa7eINdJ5S+20TH6oKv+ADQOHcMZ3XzO4DuK 20Z7CLLAtY25C7GlcWR9X/beIjn123YQGGlIrKcegBdV/8C0NjwTtSjkviQ3ncUGl0It g2XzkhOmEQnIeuBjBRxV9MVzd/X4a1PKejIOhZY++ZshuqEs7FSIrfQ0qAP9FkbIGpLL +gtg== MIME-Version: 1.0 Received: by 10.220.157.75 with SMTP id a11mr17752846vcx.27.1350944147926; Mon, 22 Oct 2012 15:15:47 -0700 (PDT) Received: by 10.58.226.228 with HTTP; Mon, 22 Oct 2012 15:15:47 -0700 (PDT) In-Reply-To: <45206234D3584F47B7ADCEA7B2EDC30931815C0C@NDHEP50005.na.corp.mckesson.com> References: <45206234D3584F47B7ADCEA7B2EDC30931815864@NDHEP50005.na.corp.mckesson.com> <45206234D3584F47B7ADCEA7B2EDC30931815C0C@NDHEP50005.na.corp.mckesson.com> Date: Mon, 22 Oct 2012 17:15:47 -0500 Message-ID: Subject: Re: DELETE query failing in CQL 3.0 From: Tyler Hobbs To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=f46d043be1de0c6fd004ccad3282 X-Gm-Message-State: ALoCoQkAdOGu5ywuV85GLLLMvW9dfBFRaeVP4SMJpPjFtWQe6Py3gf/z5skclBsvSektkd96CzXk X-Virus-Checked: Checked by ClamAV on apache.org --f46d043be1de0c6fd004ccad3282 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable For what it's worth, Cassandra 1.2 will support deleting a slice of columns, allowing you to specify the first N components of the primary key in a WHERE clause for a DELETE statement: https://issues.apache.org/jira/browse/CASSANDRA-3708 On Mon, Oct 22, 2012 at 8:45 AM, Ryabin, Thomas wrote: > I figured out the problem. The DELETE query only works if the column > used in 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 > statement. **** > > " a table must define at least one column that is not part of the PRIMARY > 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 > 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 =93books=94, and am trying to delete all ro= ws > where the =93title=94 column is equal to =93hatchet=94. This is the query= I am > using:**** > > DELETE FROM books WHERE title =3D =91hatchet=92;**** > > **** > > 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.**** > --=20 Tyler Hobbs DataStax --f46d043be1de0c6fd004ccad3282 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable For what it's worth, Cassandra 1.2 will support deleting a slice of col= umns, allowing you to specify the first N components of the primary key in = a WHERE clause for a DELETE statement: https://issues.apache.org/jira/browse/CASSANDR= A-3708

On Mon, Oct 22, 2012 at 8:45 AM, Ryabin, Tho= mas <Thomas.Ryabin@mckesson.com> wrote:

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.

=A0<= /p>

-Thomas

=A0<= /p>

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

=A0

It is better to provide table definition.=A0I guess = the reason is below statement.=A0

" 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=A0"

Please check this document=A0her= e.=A0

=A0

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

Can you paste the table definition ?=A0

=A0

Thanks

=A0

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

Aaron Morton

Freelance Developer

@aaronmorton

=A0

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



I have a column family called =93books= =94, and am trying to delete all rows where the =93title=94 column is equal= to =93hatchet=94. This is the query I am using:

=A0=A0=A0 DELETE FROM books WHERE title= =3D =91hatchet=92;

=A0

This query is failing with this error:<= u>

=A0=A0=A0=A0Bad Request: PRIMARY KEY pa= rt title found in SET part

=A0

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

=A0

-Thomas

=A0



=A0

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




--
Tyler Hobbs
DataStax
<= br> --f46d043be1de0c6fd004ccad3282--