Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 67500 invoked from network); 8 Jun 2010 19:27:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 19:27:46 -0000 Received: (qmail 96709 invoked by uid 500); 8 Jun 2010 19:27:45 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 96689 invoked by uid 500); 8 Jun 2010 19:27:45 -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 96681 invoked by uid 99); 8 Jun 2010 19:27:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 19:27:45 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 19:27:40 +0000 Received: by wyb32 with SMTP id 32so1049881wyb.31 for ; Tue, 08 Jun 2010 12:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=MFEr79nad4+k+8OTtBetueZMMxGp3SewsK18IeuJKDI=; b=sCdy9ndwVgaXbb9oP5GwxEA6fUWeovrHp1LX8q01vMfsG2SM/YwEmcAqKpFe13WIZO KzN8JQiQFngUaUutKTpfXMUpYiTg2FLyH3SecPbiirP5UK/o0JyCHJH5vlxAQFCJVXu9 6cW1aJcf8iXAoTAYVmWq2BbnHaMZAqdLTr2gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=ZGN4pp280QBtt24y1zxpWr0PUVt3uHhUjo+vUvWE3LjUKUmbOIAX/gU+Eq2/lbsUp5 G94hE2GMc9/Xt4LOQSBOToH1wb+6yOosFuYm3c8uL+RriLXFlQwOUxM/ixeniEwWZRmi gA9JfNxVFNgD/vfmiLZOr7UDwT8OsORK7KuSE= Received: by 10.216.177.85 with SMTP id c63mr3923898wem.14.1276024742285; Tue, 08 Jun 2010 12:19:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.17.197 with HTTP; Tue, 8 Jun 2010 12:18:41 -0700 (PDT) In-Reply-To: References: <87bpbl7dgi.fsf@lifelogs.com> From: Jonathan Ellis Date: Tue, 8 Jun 2010 12:18:41 -0700 Message-ID: Subject: Re: Perl/Thrift/Cassandra strangeness To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable that does sound like a bug. can you give us the data to insert that allows reproducing this? On Tue, Jun 8, 2010 at 10:20 AM, Jonathan Shook wrote: > Possible bug... > > Using a slice range with the empty sentinel values, and a count of 1 > sometimes yields 2 ColumnOrSuperColumns, sometimes 1. > The inconsistency had lead me to believe that the count was not > working, hence the additional confusion. > > There was a particular key which returns exactly 2 > ColumnOrSuperColumns. This happened repeatedly, even when other data > was inserted before or after. All of the other keys were returning the > expected 1 ColumnOrSuperColumn. > > Once I added a 4th super column to the key in question, it started > behaving the same as the others, yielding exactly 1 > ColumnOrSuperColumn. > > here is the code: for the predicate: > > =A0 =A0 =A0 =A0my $predicate =3D new Cassandra::SlicePredicate(); > =A0 =A0 =A0 =A0my $slice_range =3D new Cassandra::SliceRange(); > =A0 =A0 =A0 =A0$slice_range->{start} =3D ''; > =A0 =A0 =A0 =A0$slice_range->{finish} =3D ''; > =A0 =A0 =A0 =A0$slice_range->{reversed} =3D 1; > =A0 =A0 =A0 =A0$slice_range->{count} =3D 1; > =A0 =A0 =A0 =A0$predicate->{slice_range} =3D $slice_range; > > The columns are in the right order (reversed), so I'll get what I need > by accessing only the first result in each slice. If I wanted to > iterate the returned list of slices, it would manifest as a bug in my > client. > > (Cassandra 6.1/Thrift/Perl) > > > On Tue, Jun 8, 2010 at 11:18 AM, Jonathan Shook wrote: >> I was misreading the result with the original slice range. >> I should have been expecting exactly 2 ColumnOrSuperColumns, which is >> what I got. I was erroneously expecting only 1. >> >> Thanks! >> Jonathan >> >> >> 2010/6/8 Ted Zlatanov : >>> On Mon, 7 Jun 2010 17:20:56 -0500 Jonathan Shook wro= te: >>> >>> JS> The point is to get the "last" super-column. >>> ... >>> JS> Is the Perl Thrift client problematic, or is there something else t= hat >>> JS> I am missing? >>> >>> Try Net::Cassandra::Easy; if it does what you want, look at the debug >>> output or trace the code to see how the predicate is specified so you >>> can duplicate that in your own code. >>> >>> In general yes, the Perl Thrift interface is problematic. =A0It's slow = and >>> semantically inconsistent. >>> >>> Ted >>> >>> >> > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com