Selaa lähdekoodia

HADOOP-3040. If the input line starts with the separator char, the key is set as empty. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@640362 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 vuotta sitten
vanhempi
commit
b2df387a47

+ 3 - 0
CHANGES.txt

@@ -346,6 +346,9 @@ Trunk (unreleased changes)
     HADOOP-3066. Should not require superuser privilege to query if hdfs is in
     safe mode (jimk)
 
+    HADOOP-3040. If the input line starts with the separator char, the key
+    is set as empty. (Amareshwari Sriramadasu via ddas) 
+
 Release 0.16.2 - Unreleased
 
   BUG FIXES

+ 1 - 1
src/contrib/streaming/src/java/org/apache/hadoop/streaming/UTF8ByteArrayUtils.java

@@ -74,7 +74,7 @@ public class UTF8ByteArrayUtils {
    */
   private static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
     int pos = -1;
-    int nextStart = start + 1;
+    int nextStart = start;
     for (int i = 0; i < n; i++) {
       pos = findByte(utf, nextStart, length, b);
       if (pos < 0) {