hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject 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
Date Thu, 19 Apr 2012 16:18:35 GMT
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);



Mime
View raw message