You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Madhukar Pandey <ma...@easility.com> on 2013/06/26 09:03:30 UTC

HBase: Filters not working for negative integers

We have implemented QualifierFilter as well as ValueFilter (using
BinaryComparator) of Hbase successfully and they are working fine for most
of our cases. However they are failing in cases like number > -10 or number
< -10

Please note that number = -10 is working perfectly fine. Also, number > 10
and number < 10 are also working fine.

If you want to see the code, please check following links:
1. Q<https://github.com/deanhiller/playorm/blob/master/src/main/java/com/alvazan/orm/layer9z/spi/db/hadoop/CursorColumnSliceHbase.java>We
have implemented QualifierFilter as well as ValueFilter (using
BinaryComparator) of Hbase successfully and they are working fine for most
of our cases. However they are failing in cases like number > -10 or number
< -10


Please note that number = -10 is working perfectly fine. Also, number > 10
and number < 10 are also working fine.


If you want to see the code, please check following links:

1. QualifierFilter - Relevant lines are 126-142

2. Value Filter - Relevant lines are 107-128


As per this blog, this can be an issue with serialization if we want to
store negative values for rowkeys and we should write our own serializers
for comparison.

So we wanted to know:

1. Is it really necessary to write our own serializer in this case?

2. If yes, how? Any example would be great
help.ualifierFilter<https://github.com/deanhiller/playorm/blob/master/src/main/java/com/alvazan/orm/layer9z/spi/db/hadoop/CursorColumnSliceHbase.java>
-
Relevant lines are 126-142
2. Value Filter<https://github.com/deanhiller/playorm/blob/master/src/main/java/com/alvazan/orm/layer9z/spi/db/hadoop/CursorOfHbaseIndexes.java>
-
Relevant lines are 107-128

As per this blog <http://flurrytechblog.wordpress.com/2012/06/12/137492485/>,
this can be an issue with serialization if we want to store negative values
for rowkeys and we should write our own serializers for comparison.
So we wanted to know:
1. Is it really necessary to write our own serializer in this case?
2. If yes, how? Any example would be great help.