pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvrya...@apache.org
Subject svn commit: r1147435 - in /pig/trunk: CHANGES.txt src/org/apache/pig/builtin/TOTUPLE.java test/org/apache/pig/test/TestBuiltin.java
Date Sat, 16 Jul 2011 15:22:05 GMT
Author: dvryaboy
Date: Sat Jul 16 15:22:04 2011
New Revision: 1147435

URL: http://svn.apache.org/viewvc?rev=1147435&view=rev
Log:
PIG-2161: TOTUPLE should use no-copy tuple creation (dvryaboy)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/builtin/TOTUPLE.java
    pig/trunk/test/org/apache/pig/test/TestBuiltin.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1147435&r1=1147434&r2=1147435&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sat Jul 16 15:22:04 2011
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-2161: TOTUPLE should use no-copy tuple creation (dvryaboy)
+
 PIG-1946: HBaseStorage constructor syntax is error prone (billgraham via dvryaboy)
 
 PIG-2001: DefaultTuple(List) constructor is inefficient, causes List.size()

Modified: pig/trunk/src/org/apache/pig/builtin/TOTUPLE.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/TOTUPLE.java?rev=1147435&r1=1147434&r2=1147435&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/TOTUPLE.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/TOTUPLE.java Sat Jul 16 15:22:04 2011
@@ -18,13 +18,9 @@
 package org.apache.pig.builtin;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.pig.EvalFunc;
 import org.apache.pig.data.DataType;
 import org.apache.pig.data.Tuple;
-import org.apache.pig.data.TupleFactory;
 import org.apache.pig.impl.logicalLayer.schema.Schema;
 
 /**
@@ -36,15 +32,7 @@ public class TOTUPLE extends EvalFunc<Tu
 
     @Override
     public Tuple exec(Tuple input) throws IOException {
-        try {
-            List<Object> items = new ArrayList<Object>();
-            for (int i = 0; i < input.size(); ++i) {
-                items.add(input.get(i));
-            }
-            return TupleFactory.getInstance().newTuple(items);
-        } catch (Exception e) {
-            throw new RuntimeException("Error while creating a tuple", e);
-        }
+       return input;
     }
 
     @Override

Modified: pig/trunk/test/org/apache/pig/test/TestBuiltin.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestBuiltin.java?rev=1147435&r1=1147434&r2=1147435&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestBuiltin.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestBuiltin.java Sat Jul 16 15:22:04 2011
@@ -1742,7 +1742,6 @@ public class TestBuiltin {
         }
 
         Tuple output = tt.exec(input);
-        assertTrue(!(input == output));
         assertEquals(input, output);
 
 	// TOMAP - construct a map from input fields



Mime
View raw message