[HBase] Filters not working for negative integers

[stackoverflow] HBase: Filters not working for negative integers

Easility say:
Since, Hbase has only BinaryComparators and not other ‘typed’ comparators, it fails to filter on Negative integers as it stores the 2’s compliment of the negative number. Further, the binary representation of a negative 2’s Complement Integer would be lexicographically after the largest positive number and that’s why it was not working.

The workaround is to change the signed bit of the number. Things are working fine after that. Please note that this is required only for integers and not for float types.

This entry was posted in HBase. Bookmark the permalink.