hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Brown <tombrow...@gmail.com>
Subject Re: sorting by value
Date Fri, 31 Aug 2012 06:12:22 GMT
We do numerical sorting within some of our tables.  We put the numerical
values as fixed length byte arrays within the keys (and flipped the sign
bit so negative values are lexigraphically lower than positive values)

Of course, it's still part of the key so that technique doesn't work for
everyone, but it does allow us to do some limited sorting.


On Thursday, August 30, 2012, Stack wrote:

> On Tue, Aug 28, 2012 at 4:11 PM, Pamecha, Abhishek <apamecha@x.com<javascript:;>>
> wrote:
> > Hi
> >
> > I probably know the usual answer but are there any tricks to do some
> sort of sort by value in HBase. The only option I know is to somehow embed
> value in the key part. The value is not a timestamp but a normal number.
> >
> > I want to find out, say, top 10 from a range of columns. The range could
> be millions of columns. The range is dynamic for the most part.
> >
> > Any pointers?
> >
> HBase sorts by rows and then within a row by column family, column
> qualifier, type, then timestamp.  You cannot have it natively sort
> values for you, not unless you make the values be rows and/or columns
> in another, separate table.
> St.Ack

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message