You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/02/16 03:45:31 UTC

[GitHub] [hbase] GeorryHuang commented on a change in pull request #4105: HBASE-26742 Comparator of NOT_EQUAL NULL is invalid for checkAndMutate

GeorryHuang commented on a change in pull request #4105:
URL: https://github.com/apache/hbase/pull/4105#discussion_r804542864



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -4937,11 +4937,11 @@ private CheckAndMutateResult checkAndMutateInternal(CheckAndMutate checkAndMutat
             boolean valueIsNull =
               comparator.getValue() == null || comparator.getValue().length == 0;
             if (result.isEmpty() && valueIsNull) {
-              matches = true;
-            } else if (result.size() > 0 && result.get(0).getValueLength() == 0 && valueIsNull) {
-              matches = true;
+              matches = op != CompareOperator.NOT_EQUAL;

Review comment:
       As far as i know, checkAndMutate ignores the case where the comparator's value is null or empty. If the value of result is empty too, no matter what the comparator is, matches set as true. If we change the logic of NOT_EQUAL, should we also change logic such as GREATER and LESS?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org