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 88A5E11AD1 for ; Tue, 22 Apr 2014 01:50:35 +0000 (UTC) Received: (qmail 61763 invoked by uid 500); 22 Apr 2014 01:50:32 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 61728 invoked by uid 500); 22 Apr 2014 01:50:32 -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 61720 invoked by uid 99); 22 Apr 2014 01:50:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 01:50:32 +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 eric.plowe@gmail.com designates 209.85.219.46 as permitted sender) Received: from [209.85.219.46] (HELO mail-oa0-f46.google.com) (209.85.219.46) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 01:50:27 +0000 Received: by mail-oa0-f46.google.com with SMTP id m1so3064821oag.19 for ; Mon, 21 Apr 2014 18:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lUGQOAewn1aNKowRgQ83ovoD6bC8YAmkdLvCY+q+BKg=; b=Gkntu5FG0GMSQ2o+RuQKPAnKIxgSuOoMrcbY++kUzLEunJ6tzFlDIL9eOLE0nfsWY1 MdE1z8x9ca8yeaGY6HkQ8mG0XO3Q+bEV6keq3BBbEu1hl7r+y6mSQxt24pH7y9mfNXWp 0+NQk3F8zHaU3yXdYEsgvhblHGgSjD5pyfJ36H9GzMgpXHfQvgQGLxX5Et0Prshtp5dz pRyOcGmrnnSm7xJOs/obIzvP3XLTqwKHvjFc90Dbp3Sw9l4Su0uyj57ArUa/82KkpBN1 RbjUqxd+oePJksxAGt22GBNR9276RxvgjHKYra1A01ANNqXTNpRaJFc77dUraE83NfTp /UbQ== MIME-Version: 1.0 X-Received: by 10.182.28.134 with SMTP id b6mr35040652obh.27.1398131404759; Mon, 21 Apr 2014 18:50:04 -0700 (PDT) Received: by 10.182.78.229 with HTTP; Mon, 21 Apr 2014 18:50:04 -0700 (PDT) In-Reply-To: <5355B35B.7070507@googlemail.com> References: <534E50A4.9030805@gmail.com> <5355B35B.7070507@googlemail.com> Date: Mon, 21 Apr 2014 21:50:04 -0400 Message-ID: Subject: Re: Deleting column names From: Eric Plowe To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=001a11c2903cbae8c604f797d5a7 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2903cbae8c604f797d5a7 Content-Type: text/plain; charset=UTF-8 Setting the columns to null is essentially deleting them from my understanding. A delete operation works on the entire row. 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 >> > > --001a11c2903cbae8c604f797d5a7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Setting the columns to null is essentially deleting them from my understand= ing. A delete operation works on the entire row.

On Mon= day, 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 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

--001a11c2903cbae8c604f797d5a7--