You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2012/04/19 18:18:35 UTC

svn commit: r1328025 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java

Author: tedyu
Date: Thu Apr 19 16:18:35 2012
New Revision: 1328025

URL: http://svn.apache.org/viewvc?rev=1328025&view=rev
Log:
HBASE-5821  Incorrect handling of null value in Coprocessor aggregation function min() (Maryann Xue)

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1328025&r1=1328024&r2=1328025&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Thu Apr 19 16:18:35 2012
@@ -43,6 +43,7 @@ Release 0.92.2 - Unreleased
    HBASE-5780  Fix race in HBase regionserver startup vs ZK SASL authentication (Shaneal Manek)
    HBASE-5823  HBASE-5823 Hbck should be able to print help (Enis Soztutar)
    HBASE-5787  Table owner can't disable/delete its own table (Matteo)
+   HBASE-5821  Incorrect handling of null value in Coprocessor aggregation function min() (Maryann Xue)
 
   IMPROVEMENTS
    HBASE-5592  Make it easier to get a table from shell (Ben West)

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java?rev=1328025&r1=1328024&r2=1328025&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java Thu Apr 19 16:18:35 2012
@@ -94,7 +94,7 @@ public class AggregationClient {
 
       @Override
       public synchronized void update(byte[] region, byte[] row, R result) {
-        max = ci.compare(max, result) < 0 ? result : max;
+        max = (max == null || (result != null && ci.compare(max, result) < 0)) ? result : max;
       }
     }
     MaxCallBack aMaxCallBack = new MaxCallBack();
@@ -144,7 +144,7 @@ public class AggregationClient {
 
       @Override
       public synchronized void update(byte[] region, byte[] row, R result) {
-        min = (min == null || ci.compare(result, min) < 0) ? result : min;
+        min = (min == null || (result != null && ci.compare(result, min) < 0)) ? result : min;
       }
     }
     HTable table = new HTable(conf, tableName);

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java?rev=1328025&r1=1328024&r2=1328025&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java Thu Apr 19 16:18:35 2012
@@ -67,7 +67,7 @@ public class AggregateImplementation ext
         hasMoreRows = scanner.next(results);
         for (KeyValue kv : results) {
           temp = ci.getValue(colFamily, qualifier, kv);
-          max = (max == null || ci.compare(temp, max) > 0) ? temp : max;
+          max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max;
         }
         results.clear();
       } while (hasMoreRows);
@@ -96,7 +96,7 @@ public class AggregateImplementation ext
         hasMoreRows = scanner.next(results);
         for (KeyValue kv : results) {
           temp = ci.getValue(colFamily, qualifier, kv);
-          min = (min == null || ci.compare(temp, min) < 0) ? temp : min;
+          min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;
         }
         results.clear();
       } while (hasMoreRows);