hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Koch <ogd...@googlemail.com>
Subject Re: Using doubles and longs as ordering row values
Date Thu, 29 Nov 2012 23:00:20 GMT
Hello,

I am having a similar issue, only I need to preserve the order of
qualifiers which are serialized signed longs - rather than row keys. The
latter is addressed by the orderly library which was mentioned above. Can
this library be re-used for my purpose? I imagine this is not an exotic
requirement so I am also interested in knowing how other people have solved
this problem.

Thank you,

/David


On Tue, Nov 6, 2012 at 6:07 AM, Jonathan Bishop <jbishop.rwc@gmail.com>wrote:

> Thanks Dave,
>
> That looks like what I need.
>
> Jon
>
>
> On Mon, Nov 5, 2012 at 4:27 PM, Dave Latham <latham@davelink.net> wrote:
>
> > This fork looks a bit more up to date:
> > https://github.com/ndimiduk/orderly
> >
> > On Mon, Nov 5, 2012 at 4:26 PM, Dave Latham <latham@davelink.net> wrote:
> >
> > > Here's a project to deal with this issue specifically.  I'm not sure of
> > > it's status:
> > > https://github.com/conikeec/orderly
> > >
> > >
> > > On Mon, Nov 5, 2012 at 4:01 PM, lars hofhansl <lhofhansl@yahoo.com>
> > wrote:
> > >
> > >> Have a look at the lily library. It has code to encode Longs/Doubles
> > into
> > >> bytes such that resulting bytes sort as expected based on the numbers.
> > >>
> > >> -- Lars
> > >>
> > >>
> > >>
> > >> ________________________________
> > >>  From: Jonathan Bishop <jbishop.rwc@gmail.com>
> > >> To: "user@hbase.apache.org" <user@hbase.apache.org>
> > >> Sent: Monday, November 5, 2012 10:41 AM
> > >> Subject: Using doubles and longs as ordering row values
> > >>
> > >> Hi,
> > >>
> > >> In my application my row values are doubles. I would like my scans to
> > >> traverse the rows in order of increasing values.
> > >>
> > >> But if I simply use
> > >>
> > >> double d  = ....
> > >> byte[] row = Bytes.toBytes(d);
> > >>
> > >> I will get an ordering which is based on the byte values of doubles,
> not
> > >> on
> > >> the value of the doubles themselves.
> > >>
> > >> I see also that integer values have the same issue due to the first
> bit
> > >> being the sign bit. So negative values will come after positive
> values.
> > >>
> > >> Any suggestions?
> > >>
> > >> Thanks,
> > >>
> > >> Jon
> > >>
> > >
> > >
> >
>

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