pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1211619 - in /pig/trunk: CHANGES.txt src/org/apache/pig/builtin/JsonLoader.java src/org/apache/pig/impl/streaming/OutputHandler.java
Date Wed, 07 Dec 2011 20:24:39 GMT
Author: daijy
Date: Wed Dec  7 20:24:38 2011
New Revision: 1211619

URL: http://svn.apache.org/viewvc?rev=1211619&view=rev
Log:
PIG-2374: streaming regression with dotNext

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/builtin/JsonLoader.java
    pig/trunk/src/org/apache/pig/impl/streaming/OutputHandler.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1211619&r1=1211618&r2=1211619&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Dec  7 20:24:38 2011
@@ -324,6 +324,8 @@ Release 0.9.2 - Unreleased
 
 BUG FIXES
 
+PIG-2374: streaming regression with dotNext (daijy)
+
 PIG-2387: BinStorageRecordReader causes negative progress (xutingz via daijy)
 
 PIG-2354: Several fixes for bin/pig (daijy)

Modified: pig/trunk/src/org/apache/pig/builtin/JsonLoader.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/JsonLoader.java?rev=1211619&r1=1211618&r2=1211619&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/JsonLoader.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/JsonLoader.java Wed Dec  7 20:24:38 2011
@@ -132,7 +132,9 @@ public class JsonLoader extends LoadFunc
 
         // Create a parser specific for this input line.  This may not be the
         // most efficient approach.
-        ByteArrayInputStream bais = new ByteArrayInputStream(val.getBytes());
+        byte[] newBytes = new byte[val.getLength()];
+        System.arraycopy(val.getBytes(), 0, newBytes, 0, val.getLength());
+        ByteArrayInputStream bais = new ByteArrayInputStream(newBytes);
         JsonParser p = jsonFactory.createJsonParser(bais);
 
         // Create the tuple we will be returning.  We create it with the right

Modified: pig/trunk/src/org/apache/pig/impl/streaming/OutputHandler.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/impl/streaming/OutputHandler.java?rev=1211619&r1=1211618&r2=1211619&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/impl/streaming/OutputHandler.java (original)
+++ pig/trunk/src/org/apache/pig/impl/streaming/OutputHandler.java Wed Dec  7 20:24:38 2011
@@ -89,7 +89,9 @@ public abstract class OutputHandler {
             return null;
         }
         
-        return deserializer.deserialize(value.getBytes());
+        byte[] newBytes = new byte[value.getLength()];
+        System.arraycopy(value.getBytes(), 0, newBytes, 0, value.getLength());
+        return deserializer.deserialize(newBytes);
     }
     
     /**



Mime
View raw message