hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jtay...@salesforce.com>
Subject Re: how to reverse an integer for rowkey?
Date Thu, 27 Mar 2014 16:59:43 GMT
Another option is to use Apache Phoenix and let it do these things for you:
    CREATE TABLE my_table(
        intField INTEGER,
        strField VARCHAR,
        CONSTRAINT pk PRIMARY KEY (intField DESC, strField));


On Thu, Mar 27, 2014 at 1:24 AM, Li Li <fancyerii@gmail.com> wrote:

> my rowkey is <strField,intField>
> I want to scan it by decreasing order of the int field, how to make it
> reversed?
> if the row key is Bytes.toBytes(intField) + Bytes.toBytes(strField),
> then the order is increasing.
> one solution is replace intField with -intField. but if
> intField==Integer.MIN_VALUE, what will happen?

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