Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 47623 invoked from network); 26 Oct 2009 01:34:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Oct 2009 01:34:56 -0000 Received: (qmail 1498 invoked by uid 500); 26 Oct 2009 01:34:56 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 1459 invoked by uid 500); 26 Oct 2009 01:34:56 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 1449 invoked by uid 99); 26 Oct 2009 01:34:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 01:34:56 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of michael.greene@gmail.com designates 209.85.219.209 as permitted sender) Received: from [209.85.219.209] (HELO mail-ew0-f209.google.com) (209.85.219.209) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 01:34:50 +0000 Received: by ewy5 with SMTP id 5so7521320ewy.12 for ; Sun, 25 Oct 2009 18:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uj1+XvuHCWZfmpQTvPF0Dj+QEY86XtboWF06ftpAv94=; b=BjH4Z/DF0zQ2viw0bBubgQgllIXJephBf3zAt5bFvBHozZrJnpQtc3UpLF7+rKfak/ uHQB8WKuL0jEIdt9jJsU4S4skFPhGTYGy6GKp8RrFdAXBn+BSTaShvgnKrKiywB9+VbF +qN/8CS5eTI1qkzMjcHIWLJuYgYs5wgs+IG5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v2U/inZupWif7ocWCzCt3h2G8kSEusA7v6csx3HpExeE1C7liwV4Vw+Cx3iHjADmA7 BFI6oxF1g9+psE9Z7+ZNb1i8i0sQgofyotCiJ4GVNUKJ/KIMFv5txPoV7qRsyN4MBQKx bfrBjSEkE4r57FapGNNBPS9OSsuAh6JGMhh4w= MIME-Version: 1.0 Received: by 10.216.91.82 with SMTP id g60mr5078425wef.98.1256520869369; Sun, 25 Oct 2009 18:34:29 -0700 (PDT) In-Reply-To: References: Date: Sun, 25 Oct 2009 20:34:29 -0500 Message-ID: Subject: Re: are columns of a supercolumn name sorted? From: Michael Greene To: cassandra-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable "reversed" is a boolean option on the SliceRange that you pass in the get_slice method via its predicate parameter. Michael On Sun, Oct 25, 2009 at 8:26 PM, kevin wrote: > hi jonathan > thanks for the clarification. > >>>>subcolumns is what you want (with the reverse option to slice, to get >>>> most-recent-first). > > is reverse an option in get_slice method or in my python code or in the > config file? > > > > On Sun, Oct 25, 2009 at 5:40 PM, Jonathan Ellis wrote= : >> >> Sorry, the paragraph about subcolumns always being sorted by time is >> outdated. =A0(I've taken it out on the 0.4 branch now -- it was already >> gone in trunk.) =A0Read just below that about how comparewith and >> comparesubcolumnswith work. =A0Sounds like using TimeUUIDType for >> subcolumns is what you want (with the reverse option to slice, to get >> most-recent-first). >> >> On Sun, Oct 25, 2009 at 5:17 PM, kevin wrot= e: >> > i am inserting three columns x,a,z into a super column named 'sc_2'. t= he >> > config file says that the columns of a super column are timesorted, bu= t >> > when >> > i get_slice it is sorted by the name of the columns. how do i get it >> > time >> > sorted so that i get the most recently inserted/updated column first? >> > cassandra version apache-cassandra-incubating-0.4.1-bin.tar.gz, and >> > lazyboy >> > latest git clone. >> > thanks >> > >> > >> >>>> import lazyboy,time, pprint >> >>>> from cassandra import Cassandra >> >>>> from cassandra.ttypes import * >> > >> > >> >>>> client=3Dlazyboy.connection.Client(['localhost:9160']) >> >>>> keyspace =3D "Keyspace1" >> >>>> key=3D'mykeyx' >> >>>> column_path =3D >> >>>> ColumnPath(column_family=3D"Super1",column=3D"x",super_column=3D'sc= _2') >> >>>> client.insert(keyspace, key, column_path, 'a', time.time(), >> >>>> ConsistencyLevel.ONE); >> >>>> column_path =3D >> >>>> ColumnPath(column_family=3D"Super1",column=3D"a",super_column=3D'sc= _2') >> >>>> client.insert(keyspace, key, column_path, 'a', time.time(), >> >>>> ConsistencyLevel.ONE); >> >>>> column_path =3D >> >>>> ColumnPath(column_family=3D"Super1",column=3D"z",super_column=3D'sc= _2') >> >>>> client.insert(keyspace, key, column_path, 'a', time.time(), >> >>>> ConsistencyLevel.ONE); >> > >> > >> >>>> slice_range =3D SliceRange(start=3D"", finish=3D"") >> >>>> predicate =3D SlicePredicate(slice_range=3Dslice_range) >> >>>> column_parent =3D ColumnParent(column_family=3D"Super1") >> >>>> client.get_slice(keyspace, key, column_parent, predicate, >> >>>> ConsistencyLevel.ONE) >> > [ColumnOrSuperColumn(column=3DNone, super_column=3DSuperColumn(name=3D= 'sc_2', >> > columns=3D[Column(timestamp=3D1256512261, name=3D'a', value=3D'a'), >> > Column(timestamp=3D1256512252, name=3D'x', value=3D'a'), >> > Column(timestamp=3D1256512267, name=3D'z', value=3D'a')]))] >> > > >