Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 90344 invoked from network); 27 Dec 2010 04:36:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Dec 2010 04:36:04 -0000 Received: (qmail 8779 invoked by uid 500); 27 Dec 2010 04:36:02 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 8644 invoked by uid 500); 27 Dec 2010 04:36:01 -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 8636 invoked by uid 99); 27 Dec 2010 04:36:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 04:36:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of roshandawrani@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; Mon, 27 Dec 2010 04:35:54 +0000 Received: by wyf23 with SMTP id 23so8457338wyf.31 for ; Sun, 26 Dec 2010 20:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=oxjZSqjwWviEiVPC0NHg64Jp3OHuycCaCfA2CBGQJUw=; b=M2RGpc1GKuz1OQFf+s366DBxMgvbj1pTvMDes03sqgfnANJFitvx4wzHKwF6Vix9TO 4tO5E7O/fO5O+DwFuhgZh5kauhadmiapPZShcAi3ua1qO6lY2BU2eyDoyYMb/63LOvVL CwONW2lnoao8ZCisIUF59UWJ8ZgB9k1xzaCDg= 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; b=u7S6S9n2P5m4X8vg2HeNfgOKugiwccEedj5RJhjlDJjuylql1UUwJkF+FjH9SgmnHA X/DdPLURBGndnZWia7UVKE4FQZ1EeYOYOOc0fbbDvbJRJrC+jfXNqme8xk//H8XOUuZW tZBkJ8F1XOtK3iimw7/ltHB/VB95L3lBOOYak= MIME-Version: 1.0 Received: by 10.216.173.15 with SMTP id u15mr12428001wel.83.1293424533760; Sun, 26 Dec 2010 20:35:33 -0800 (PST) Received: by 10.216.13.5 with HTTP; Sun, 26 Dec 2010 20:35:33 -0800 (PST) In-Reply-To: References: Date: Mon, 27 Dec 2010 10:05:33 +0530 Message-ID: Subject: Re: Retrieving TimeUUID sub-columns in reverse order From: Roshan Dawrani To: user@cassandra.apache.org, hector-users@googlegroups.com Content-Type: multipart/alternative; boundary=00163641691be0ea5404985cddc7 X-Virus-Checked: Checked by ClamAV on apache.org --00163641691be0ea5404985cddc7 Content-Type: text/plain; charset=ISO-8859-1 Thanks, but unfortunately, I need to fetch multiple super columns - each super column represents a particular "state" and as entities transition from one state to another, they move from one super column to another. So, there is no way currently I can retrieve multiple super columns with their sub-cols reverse sorted? If I need it, I will need to fire a separate query for each "state" super column? On Mon, Dec 27, 2010 at 9:59 AM, Jonathan Ellis wrote: > If you are fetching multiple supercolumns, then that's what you can > control the order of. If you are slicing within a single supercolumn, > the reverse parameter will affect the order of subcolumns. > > On Sun, Dec 26, 2010 at 6:11 AM, Roshan Dawrani > wrote: > > Hi Ran, > > I am not doing it the YAML way. I am defining my SCF through Hector API > as > > below > > > > ================================================================ > > ThriftCfDef cfDef = HFactory.createColumnFamilyDefinition(ksName, "SCF") > > cfDef.setColumnMetadata(...) > > cfDef.setColumnType(ColumnType.SUPER) > > cfDef.setSubComparatorType(ComparatorType.TIMEUUIDTYPE) > > ================================================================ > > > > And this is the structure of the SCF: > > ================================================================ > > "key1" : > > "superCol1": > > SubColName1 (TimeUUID) : null > > SubColName2 (TimeUUID) : null > > SubColName3 (TimeUUID) : null > > "superCol2": > > SubColName4 (TimeUUID) : null > > SubColName5 (TimeUUID) : null > > SubColName6 (TimeUUID) : null > > ================================================================ > > > > I now try to retrieve the data as below, but for both reverse = true | > > false, it's only the order of supercolumns that changes. The subcolumns > > always come in the same order - oldest to newest > > > > ================================================================ > > RangeSuperSlicesQuery#setRange (null, null, reverse, Integer.MAX_VALUE) > // > > reverse = true | false > > ================================================================ > > > > Anything I am doing wrong here? > > > > -- > > Roshan > > Blog: http://roshandawrani.wordpress.com/ > > Twitter: @roshandawrani > > Skype: roshandawrani > > > > On Sun, Dec 26, 2010 at 5:31 PM, Ran Tavory wrote: > >> > >> Roshan, in cassandra.yaml did you define compare_subcolumns_with for > the > >> SCF? > >> The subcolumn names are the timeuuid, not the subcolumn values, right? > >> > >> On Sun, Dec 26, 2010 at 9:14 AM, Roshan Dawrani < > roshandawrani@gmail.com> > >> wrote: > >>> > >>> Hi, > >>> > >>> I have a super ColumnFamily that has a few super columns, with each > >>> having a growing list of sub-columns where column name is a TimeUUID, > so the > >>> sub-columns get stored chronologically (oldest to newest) > >>> > >>> When I retrieve this data, can I somehow retrieve the sub-columns in > >>> reverse order - newest first? > >>> > >>> I am using RangeSuperSlicesQuery to query the super columns and setting > a > >>> range on it with reverse = true, but that only sorts the data by super > >>> column names. > >>> > >>> How can I tell RangeSuperSlicesQuery to get the sub-columns also in > >>> reverse order? > >>> > >>> Thanks. > >>> > >>> -- > >>> Roshan > >>> Blog: http://roshandawrani.wordpress.com/ > >>> Twitter: @roshandawrani > >>> Skype: roshandawrani > >> > >> > >> > >> -- > >> /Ran > > > > > > > > -- > Jonathan Ellis > Project Chair, Apache Cassandra > co-founder of Riptano, the source for professional Cassandra support > http://riptano.com > --00163641691be0ea5404985cddc7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, but unfortunately, I need to fetch multiple super columns - each su= per column represents a particular "state" and as entities transi= tion from one state to another, they move from one super column to another.=

So, there is no way currently I can retrieve multiple super columns wit= h their sub-cols reverse sorted? If I need it, I will need to fire a separa= te query for each "state" super column?


On Mon, Dec 27, 2010 at 9:59 AM, Jonathan Ellis <jbellis@gmail.com> wrote:
=
If you are fetching multiple supercolumns, then that's what you can
control the order of. =A0If you are slicing within a single supercolumn, the reverse parameter will affect the order of subcolumns.

On Sun, Dec 26, 2010 at 6:11 AM, Roshan Dawrani <roshandawrani@gmail.com> wrote:
> Hi Ran,
> I am not doing it the YAML way. I am defining my SCF through Hector AP= I as
> below
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> ThriftCfDef cfDef =3D HFactory.createColumnFamilyDefinition(ksName, &q= uot;SCF")
> cfDef.setColumnMetadata(...)
> cfDef.setColumnType(ColumnType.SUPER)
> cfDef.setSubComparatorType(ComparatorType.TIMEUUIDTYPE)
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> And this is the structure of the SCF:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> "key1" :
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 "superCol1":
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName1 (T= imeUUID) : null
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName2 (T= imeUUID) : null
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName3 (T= imeUUID) : null
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 "superCol2":
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName4 (T= imeUUID) : null
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName5 (T= imeUUID) : null
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 SubColName6 (T= imeUUID) : null
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> I now try to retrieve the data as below, but for both reverse =3D true= |
> false, it's only the order of supercolumns that changes. The subco= lumns
> always come in the same order - oldest to newest
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RangeSuperSlicesQuery#setRange (null, null, reverse, Integer.MAX_VALUE= ) //
> reverse =3D true | false
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Anything I am doing wrong here?
>
> --
> Roshan
> Blog: http://roshandawrani.wordpress.com/
> Twitter: @roshandawrani
> Skype: roshandawrani
>
> On Sun, Dec 26, 2010 at 5:31 PM, Ran Tavory <rantav@gmail.com> wrote:
>>
>> Roshan, in cassandra.yaml did you define=A0compare_subcolumns_with= =A0for the
>> SCF?
>> The subcolumn names are the timeuuid, not the subcolumn values, ri= ght?
>>
>> On Sun, Dec 26, 2010 at 9:14 AM, Roshan Dawrani <roshandawrani@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I have a super ColumnFamily that has a few super columns, with= each
>>> having a growing list of sub-columns where column name is a Ti= meUUID, so the
>>> sub-columns get stored chronologically (oldest to newest)
>>>
>>> When I retrieve this data, can I somehow retrieve the sub-colu= mns in
>>> reverse order - newest first?
>>>
>>> I am using RangeSuperSlicesQuery to query the super columns an= d setting a
>>> range on it with reverse =3D true, but that only sorts the dat= a by super
>>> column names.
>>>
>>> How can I tell RangeSuperSlicesQuery to get the sub-columns al= so in
>>> reverse order?
>>>
>>> Thanks.
>>>
>>> --
>>> Roshan
>>> Blog: http://roshandawrani.wordpress.com/
>>> Twitter: @roshandawrani
>>> Skype: roshandawrani
>>
>>
>>
>> --
>> /Ran
>
>



--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

--00163641691be0ea5404985cddc7--