Jonathan Bishop 2012-11-05, 18:41
-Re: Using doubles and longs as ordering row values
Jean-Daniel Cryans 2012-11-05, 19:38
On Mon, Nov 5, 2012 at 10:41 AM, Jonathan Bishop <[EMAIL PROTECTED]> wrote:
> 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.
It's the same ordering as long as you don't use negative values.
> 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?
Don't use row keys that can be negative? :)
Also don't use a single number as a row key, see
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
Jonathan Bishop 2012-11-06, 05:07
David Koch 2012-12-01, 15:01
Marcos Ortiz 2012-12-01, 15:27