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

Clint Morgan commented on HBASE-1264:
-------------------------------------

I found that this patch broke all my uses of ColumnValueFilter with the EQUAL 
and NOT_EQUAL operator.

It is now the case that a new ColumnFilter("A:B", EQUAL, "FOO") will filter out 
rows where column A:B has value of FOO. Whereas the past (and expected?) 
behavior is to filter out rows whose value is *not* "FOO" IE match rows where 
"A:B"="FOO".

The relevant part of the patch is:

Index: src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
===================================================================
--- src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java      
(revision 771453)
+++ src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java      
(working copy)
@@ -172,9 +172,9 @@
     case LESS_OR_EQUAL:
       return compareResult < 0;
     case EQUAL:
+      return compareResult == 0;
+    case NOT_EQUAL:
       return compareResult != 0;
-    case NOT_EQUAL:
-      return compareResult == 0;
     case GREATER_OR_EQUAL:
       return compareResult > 0;
     case GREATER:

which I think should be reverted.

> Wrong return values of comparators for ColumnValueFilter
> --------------------------------------------------------
>
>                 Key: HBASE-1264
>                 URL: https://issues.apache.org/jira/browse/HBASE-1264
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: filters
>    Affects Versions: 0.19.1
>         Environment: Ubuntu 8.04 (64 Bit), JDK 1.6
>            Reporter: Thomas Schneider
>            Priority: Minor
>             Fix For: 0.19.2, 0.20.0
>
>         Attachments: hbase-1264-2.patch, hbase-1264.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> The return values of the compareTo() method have to be changed against each 
> other. The method has to return 0 if the regex matches and 1 if it does not.

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