Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 68222 invoked from network); 17 Mar 2011 02:14:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Mar 2011 02:14:59 -0000 Received: (qmail 70037 invoked by uid 500); 17 Mar 2011 02:14:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 70012 invoked by uid 500); 17 Mar 2011 02:14:56 -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 70004 invoked by uid 99); 17 Mar 2011 02:14:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2011 02:14:56 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tyler@datastax.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2011 02:14:50 +0000 Received: by wwa36 with SMTP id 36so2791017wwa.25 for ; Wed, 16 Mar 2011 19:14:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.6.27 with SMTP id 27mr682421wem.69.1300328068160; Wed, 16 Mar 2011 19:14:28 -0700 (PDT) Received: by 10.216.30.194 with HTTP; Wed, 16 Mar 2011 19:14:28 -0700 (PDT) X-Originating-IP: [70.124.90.200] In-Reply-To: <1300327239250-6179492.post@n2.nabble.com> References: <1300225590486-6174445.post@n2.nabble.com> <1300327239250-6179492.post@n2.nabble.com> Date: Wed, 16 Mar 2011 21:14:28 -0500 Message-ID: Subject: Re: Is column update column-atomic or row atomic? From: Tyler Hobbs To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0015176f1bae981b53049ea438e1 X-Virus-Checked: Checked by ClamAV on apache.org --0015176f1bae981b53049ea438e1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable insert() will only overwrite (or insert) the columns that you supply in the dictionary. So, if you do: cf.insert('key', {'foo': 'bar'}) and the column 'foo' doesn't exist in that row yet, the column will simply be added to the other columns in the row. On Wed, Mar 16, 2011 at 9:00 PM, buddhasystem wrote: > Hello Peter, thanks for the note. > > I'm not looking for anything fancy. It's just when I'm looking at the > following bit of Pycassa docs, it's not 100% clear to me that it won't > overwrite the entire row for the key, if I want to simply add an extra > column {'foo':'bar'} to the already existing row. I don't care about > cross-node consistency at this point. > > insert(key, columns[, timestamp][, ttl][, write_consistency_level])=B6 > > Insert or update columns in the row with key key. > > columns should be a dictionary of columns or super columns to insert o= r > update. If this is a standard column family, columns should look like > {column_name: column_value}. If this is a super column family, columns > should look like {super_column_name: {sub_column_name: value}} > > -- > View this message in context: > http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Is-colum= n-update-column-atomic-or-row-atomic-tp6174445p6179492.html > Sent from the cassandra-user@incubator.apache.org mailing list archive at > Nabble.com. > --=20 Tyler Hobbs Software Engineer, DataStax Maintainer of the pycassa Cassandra Python client library --0015176f1bae981b53049ea438e1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable insert() will only overwrite (or insert) the columns that you supply in the= dictionary.=A0 So, if you do:

=A0 cf.insert('key', {'fo= o': 'bar'})

and the column 'foo' doesn't exi= st in that row yet, the column will simply be added to the other columns in= the row.

On Wed, Mar 16, 2011 at 9:00 PM, buddhasyste= m <potekhin@bnl.go= v> wrote:
Hello Peter, thanks for the note.

I'm not looking for anything fancy. It's just when I'm looking = at the
following bit of Pycassa docs, it's not 100% clear to me that it won= 9;t
overwrite the entire row for the key, if I want to simply add an extra
column {'foo':'bar'} to the already existing row. I don'= ;t care about
cross-node consistency at this point.

insert(key, columns[, timestamp][, ttl][, write_consistency_level])=B6

=A0 =A0Insert or update columns in the row with key key.

=A0 =A0columns should be a dictionary of columns or super columns to inser= t or
update. If this is a standard column family, columns should look like
{column_name: column_value}. If this is a super column family, columns
should look like {super_column_name: {sub_column_name: value}}

--
View this message in context: http://cassandra-user-incubator-= apache-org.3065146.n2.nabble.com/Is-column-update-column-atomic-or-row-atom= ic-tp6174445p6179492.html
Sent from the cassandra-user@incubator.apache.org = mailing list archive at Nabble.com.



--
Tyler Hobbs
Software Engineer, DataS= tax
Maintainer of the pycassa Cassandra Python client library
--0015176f1bae981b53049ea438e1--