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));

Thanks,
James
@JamesPlusPlus
http://phoenix.incubator.apache.org/


On Thu, Mar 27, 2014 at 1:24 AM, Li Li <[email protected]> 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?
>

Reply via email to