Author: pradeepkth
Date: Thu Jan  7 18:11:48 2010
New Revision: 896950

URL: http://svn.apache.org/viewvc?rev=896950&view=rev
Log:
PIG-1090:Update sources to reflect recent changes in load-store interfaces - 
fixed issue in TextLoader with memory reuse (pradeepkth)

Modified:
    
hadoop/pig/branches/load-store-redesign/src/org/apache/pig/builtin/TextLoader.java

Modified: 
hadoop/pig/branches/load-store-redesign/src/org/apache/pig/builtin/TextLoader.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/load-store-redesign/src/org/apache/pig/builtin/TextLoader.java?rev=896950&r1=896949&r2=896950&view=diff
==============================================================================
--- 
hadoop/pig/branches/load-store-redesign/src/org/apache/pig/builtin/TextLoader.java
 (original)
+++ 
hadoop/pig/branches/load-store-redesign/src/org/apache/pig/builtin/TextLoader.java
 Thu Jan  7 18:11:48 2010
@@ -53,7 +53,10 @@
                 return null;
             }                                                                  
                         
             Text value = (Text) in.getCurrentValue();
-            return mTupleFactory.newTuple(new DataByteArray(value.getBytes()));
+            byte[] ba = value.getBytes();
+            // make a copy of the bytes representing the input since
+            // TextInputFormat will reuse the byte array
+            return mTupleFactory.newTuple(new DataByteArray(ba, 0, 
value.getLength()));
         } catch (InterruptedException e) {
             throw new IOException("Error getting input");
         }


Reply via email to