From 8a7a750b2ef897fe3dcc4a5c66a9f0b57d921686 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 4 Nov 2008 21:39:53 +0000 Subject: [PATCH] HBASE-982 Deleting a column in MapReduce fails git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@711420 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + src/java/org/apache/hadoop/hbase/io/BatchUpdate.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a3adbec5c01..04be4da4846 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -62,6 +62,7 @@ Release 0.19.0 - Unreleased HBASE-979 REST web app is not started automatically HBASE-964 Startup stuck "waiting for root region" HBASE-980 Undo core of HBASE-975, caching of start and end row + HBASE-982 Deleting a column in MapReduce fails (Doğacan Güney via Stack) IMPROVEMENTS HBASE-901 Add a limit to key length, check key and value length on client side diff --git a/src/java/org/apache/hadoop/hbase/io/BatchUpdate.java b/src/java/org/apache/hadoop/hbase/io/BatchUpdate.java index 998760752d9..7e51e682a6d 100644 --- a/src/java/org/apache/hadoop/hbase/io/BatchUpdate.java +++ b/src/java/org/apache/hadoop/hbase/io/BatchUpdate.java @@ -97,7 +97,13 @@ public class BatchUpdate implements WritableComparable, public BatchUpdate(BatchUpdate buToCopy) { this(buToCopy.getRow(), buToCopy.getTimestamp()); for(BatchOperation bo : buToCopy) { - this.put(bo.getColumn(), bo.getValue()); + byte [] val = bo.getValue(); + if (val == null) { + // Presume a delete is intended. + this.delete(bo.getColumn()); + } else { + this.put(bo.getColumn(), val); + } } } @@ -330,4 +336,4 @@ public class BatchUpdate implements WritableComparable, public int compareTo(BatchUpdate o) { return Bytes.compareTo(this.row, o.getRow()); } -} \ No newline at end of file +}