Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Using doubles and longs as ordering row values


+
Jonathan Bishop 2012-11-05, 18:41
+
Jean-Daniel Cryans 2012-11-05, 19:38
+
anil gupta 2012-11-05, 22:57
+
lars hofhansl 2012-11-06, 00:01
+
Dave Latham 2012-11-06, 00:26
+
Dave Latham 2012-11-06, 00:27
Copy link to this message
-
Re: Using doubles and longs as ordering row values
Thanks Dave,

That looks like what I need.

Jon
On Mon, Nov 5, 2012 at 4:27 PM, Dave Latham <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>
> >> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> >> 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
> >>
> >
> >
>
+
David Koch 2012-12-01, 15:01
+
Marcos Ortiz 2012-12-01, 15:27