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

sindy commented on HBASE-3226:
------------------------------

 the switch-case  logic seem strange, for example:
 case EQUAL:
         return compareResult != 0;
 case NOT_EQUAL:
         return compareResult == 0;
I made a new project  to test just  the *doCompare ,* it didn't make the
correct result.
but from the hbase-client side test, it made the right result.
 It should have  more precessing relation behind  *doCompare*, I will keep
on it.
Thanks~

2010/11/11 stack (JIRA) <[email protected]>



-- 
Sindy Wang


> control condition error in hbase.filter.CompareFilter.doCompare  
> -----------------------------------------------------------------
>
>                 Key: HBASE-3226
>                 URL: https://issues.apache.org/jira/browse/HBASE-3226
>             Project: HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.5
>            Reporter: sindy
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> It exists in HBase 0.20.5 , and also exist in TRUNK
> org.apache.hadoop.hbase.filter.CompareFilter.doCompare(CompareOp, 
> WritableByteArrayComparable, byte[], int, int),
>   ---------------------------------------------
>   switch (compareOp) {
>       case LESS:
>         return compareResult <= 0;   
>       case LESS_OR_EQUAL:     
>         return compareResult < 0;
>       case EQUAL:
>         return compareResult != 0;
>       case NOT_EQUAL:
>         return compareResult == 0;
>       case GREATER_OR_EQUAL:
>         return compareResult > 0;
>       case GREATER:
>         return compareResult >= 0;
>       default:
>         throw new RuntimeException("Unknown Compare op " +
>           compareOp.name());
>     }
> -----------------------------------------------------
> !!! modified code:
>     switch (compareOp) {
>       case LESS:
>         return compareResult < 0;
>       case LESS_OR_EQUAL:
>         return compareResult <= 0;
>       case EQUAL:
>         return compareResult == 0;
>       case NOT_EQUAL:
>         return compareResult != 0;
>       case GREATER_OR_EQUAL:
>         return compareResult >= 0;
>       case GREATER:
>         return compareResult >0;
>       default:
>         throw new RuntimeException("Unknown Compare op " +
>           compareOp.name());
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to