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 4806611AA3 for ; Tue, 22 Apr 2014 16:05:51 +0000 (UTC) Received: (qmail 64373 invoked by uid 500); 22 Apr 2014 16:05:47 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 64341 invoked by uid 500); 22 Apr 2014 16:05:47 -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 64333 invoked by uid 99); 22 Apr 2014 16:05:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 16:05:47 +0000 X-ASF-Spam-Status: No, hits=-6.5 required=5.0 tests=ENV_AND_HDR_SPF_MATCH,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,USER_IN_DEF_SPF_WL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of michael.laing@nytimes.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qa0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 16:05:42 +0000 Received: by mail-qa0-f45.google.com with SMTP id cm18so5226281qab.18 for ; Tue, 22 Apr 2014 09:05:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=RefME5o4vt/2F6Qdz8qPnHJY+3uag0DJ4/uIg3vSTYs=; b=TmdcFFzga1tQNj2aZfsNT4iKAEVnr56BQJUnW4UfoNNmjKneG3x2oLtkGCJizwaaT8 zDB8whl07gcOgCuLk6Yxj6EIHEv+B6YwMEsCwHFITSM88p8900lq3sqildkvM3jBj3dk o7kuBM3rNiosYHzdiEHvlJcyhL6NMJL5jlXljgiNeHBe95AU5/MGJilGVHHXBRiUm+UD R+p2IiijfrJbp6rYrfMluwta3fPGF3tK/SufzIq66KPvEuvj3UUW2hh2CFZjO3FTpQQR 3wl187ovWZVWWKIqXSPuc7qiANmHuAgWCvXlEXgalUOuun790TjL+PyHJ3yTz3RvEUQ/ X2mw== X-Gm-Message-State: ALoCoQkgrkVTennQYj0syNxoFbmJaOXGlcOjvzDVslt2iP3gU6Q6G876J7yLtnEG6xohywUXtwhv MIME-Version: 1.0 X-Received: by 10.224.169.5 with SMTP id w5mr12645718qay.96.1398182718713; Tue, 22 Apr 2014 09:05:18 -0700 (PDT) Received: by 10.140.27.169 with HTTP; Tue, 22 Apr 2014 09:05:18 -0700 (PDT) In-Reply-To: References: <534E50A4.9030805@gmail.com> <5355B35B.7070507@googlemail.com> Date: Tue, 22 Apr 2014 12:05:18 -0400 Message-ID: Subject: Re: Deleting column names From: "Laing, Michael" To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0149cad44829c504f7a3c83f X-Virus-Checked: Checked by ClamAV on apache.org --089e0149cad44829c504f7a3c83f Content-Type: text/plain; charset=UTF-8 Your understanding is incorrect - the easiest way to see that is to try it. On Tue, Apr 22, 2014 at 12:00 PM, Sebastian Schmidt wrote: > From my understanding, this would delete all entries with the given s. > Meaning, if I have inserted (sa, p1, o1, c1) and (sa, p2, o2, c2), > executing this: > > DELETE FROM table_name WHERE s = sa AND p = p1 AND o = o1 AND c = c1 > > would delete sa, p1, o1, c1, p2, o2, c2. Is this correct? Or does the > above statement only delete p1, o1, c1? > > > 2014-04-22 4:00 GMT+02:00 Steven A Robenalt : > > Is there a reason you can't use: >> >> DELETE FROM table_name WHERE s = ? AND p = ? AND o = ? AND c = ?; >> >> >> On Mon, Apr 21, 2014 at 6:51 PM, Eric Plowe wrote: >> >>> Also I don't think you can null out columns that are part of the primary >>> key after they've been set. >>> >>> >>> On Monday, April 21, 2014, Andreas Wagner < >>> andreas.josef.wagner@googlemail.com> wrote: >>> >>>> Hi cassandra users, hi Sebastian, >>>> >>>> I'd be interested in this ... is there any update/solution? >>>> >>>> Thanks so much ;) >>>> Andreas >>>> >>>> On 04/16/2014 11:43 AM, Sebastian Schmidt wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm using a Cassandra table to store some data. I created the table >>>>> like >>>>> this: >>>>> CREATE TABLE IF NOT EXISTS table_name (s BLOB, p BLOB, o BLOB, c BLOB, >>>>> PRIMARY KEY (s, p, o, c)); >>>>> >>>>> I need the at least the p column to be sorted, so that I can use it in >>>>> a >>>>> WHERE clause. So as far as I understand, the s column is now the row >>>>> key, and (p, o, c) is the column name. >>>>> >>>>> I tried to delete single entries with a prepared statement like this: >>>>> DELETE p, o, c FROM table_name WHERE s = ? AND p = ? AND o = ? AND c = >>>>> ?; >>>>> >>>>> That didn't work, because p is a primary key part. It failed during >>>>> preparation. >>>>> >>>>> I also tried to use variables like this: >>>>> DELETE ?, ?, ? FROM table_name WHERE s = ?; >>>>> >>>>> This also failed during preparation, because ? is an unknown >>>>> identifier. >>>>> >>>>> >>>>> Since I have multiple different p, o, c combinations per s, deleting >>>>> the >>>>> whole row identified by s is no option. So how can I delete a s, p, o, >>>>> c >>>>> tuple, without deleting other s, p, o, c tuples with the same s? I know >>>>> that this worked with Thrift/Hector before. >>>>> >>>>> Regards, >>>>> Sebastian >>>>> >>>> >>>> >> >> >> -- >> Steve Robenalt >> Software Architect >> HighWire | Stanford University >> 425 Broadway St, Redwood City, CA 94063 >> >> srobenal@stanford.edu >> http://highwire.stanford.edu >> >> >> >> >> >> > --089e0149cad44829c504f7a3c83f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Your understanding is incorrect - the easiest way to see t= hat is to try it.


On Tue, Apr 22, 2014 at 12:00 PM, Sebastian Schmidt <isibboi@gma= il.com> wrote:
From my understanding,= this would delete all entries with the given s. Meaning, if I have inserte= d (sa, p1, o1, c1) and (sa, p2, o2, c2), executing this:

DELETE FROM table_name WHERE s =3D sa AND p =3D p1 AND o =3D o1 AND c = =3D c1

would delete sa, p1, o1, c1, p2, o2, c2. Is this correct? Or does= the above statement only delete p1, o1, c1?


2014-04-22 4:00 GMT+02:00 Steven A= Robenalt <srobenal@stanford.edu>:

Is there a reason you can&#= 39;t use:

DELETE FROM table_name WHERE s =3D ? AND p =3D ? AND o =3D ? = AND c =3D ?;


On Mon, Apr 21, 2014 at 6:51 PM, Eric Pl= owe <eric.plowe@gmail.com> wrote:
Also I don't think you can null out columns that are part of the primar= y key after they've been set.


On Monday, April= 21, 2014, Andreas Wagner <andreas.josef.wagner@googlemail.com> wro= te:
Hi cassandra users, hi Sebas= tian,

I'd be interested in this ... is there any update/solution?

Thanks so much ;)
Andreas

On 04/16/2014 11:43 AM, Sebastian Schmidt wrote:
Hi,

I'm using a Cassandra table to store some data. I created the table lik= e
this:
CREATE TABLE IF NOT EXISTS table_name (s BLOB, p BLOB, o BLOB, c BLOB,
PRIMARY KEY (s, p, o, c));

I need the at least the p column to be sorted, so that I can use it in a WHERE clause. So as far as I understand, the s column is now the row
key, and (p, o, c) is the column name.

I tried to delete single entries with a prepared statement like this:
DELETE p, o, c FROM table_name WHERE s =3D ? AND p =3D ? AND o =3D ? AND c = =3D ?;

That didn't work, because p is a primary key part. It failed during
preparation.

I also tried to use variables like this:
DELETE ?, ?, ? FROM table_name WHERE s =3D ?;

This also failed during preparation, because ? is an unknown identifier.

Since I have multiple different p, o, c combinations per s, deleting the whole row identified by s is no option. So how can I delete a s, p, o, c tuple, without deleting other s, p, o, c tuples with the same s? I know
that this worked with Thrift/Hector before.

Regards,
Sebastian




<= /div>--
Steve Robenalt
Software Architect
HighWire | Stanford University=C2= =A0
425 Broadway St, Redwoo= d City, CA 94063=C2=A0
=

srobena= l@stanford.edu







--089e0149cad44829c504f7a3c83f--