[ 
https://issues.apache.org/jira/browse/HBASE-5950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14541965#comment-14541965
 ] 

Ashish Singhi commented on HBASE-5950:
--------------------------------------

{quote}
// Scenario 3 : Compare positive long value with Negative long value using 
Binary Comparator
long l3 = 4L;
long l4 = -5L;
BinaryComparator cp2 = new BinaryComparator(Bytes.toBytes(l3));
assertEquals(1, cp2.compareTo(Bytes.toBytes(l4))); //FAIL
{quote}
Why not use LongComparator here ? If we use that I am sure it will pass.

> Add a decimal comparator for Filter
> -----------------------------------
>
>                 Key: HBASE-5950
>                 URL: https://issues.apache.org/jira/browse/HBASE-5950
>             Project: HBase
>          Issue Type: New Feature
>          Components: Filters
>    Affects Versions: 0.94.0, 0.95.2
>            Reporter: Jieshan Bean
>            Assignee: Jieshan Bean
>
> Suppose we have a requirement like below:
> we want to get the rows with one specified column value larger than A and 
> less than B.
> (They are all decimals or integers)
> namely:                         
>        A < Integer.valueof(column) < B
> Use BinaryComparator will not help us to archive that goal:
> e.g.   suppose A = 100, B = 200, one column value is 110000.
>    So it can satisfy that condition, but it's not the row we wanted.
>          
> So I suggest to add one comparator to help implementing this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to