Better would be to just reverse client-side.

On Sun, Dec 26, 2010 at 10:35 PM, Roshan Dawrani
<roshandawr...@gmail.com> wrote:
> 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 <jbel...@gmail.com> 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 <roshandawr...@gmail.com>
>> 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 <ran...@gmail.com> 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
>> >> <roshandawr...@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
>
>



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

Reply via email to