pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1036990 - in /pig/branches/branch-0.8: CHANGES.txt src/org/apache/pig/newplan/logical/expression/BinCondExpression.java test/org/apache/pig/test/TestEvalPipeline2.java
Date Fri, 19 Nov 2010 19:52:01 GMT
Author: daijy
Date: Fri Nov 19 19:52:01 2010
New Revision: 1036990

URL: http://svn.apache.org/viewvc?rev=1036990&view=rev
Log:
PIG-1719: New logical plan: FieldSchema generation for BinCond is wrong

Modified:
    pig/branches/branch-0.8/CHANGES.txt
    pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/BinCondExpression.java
    pig/branches/branch-0.8/test/org/apache/pig/test/TestEvalPipeline2.java

Modified: pig/branches/branch-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.8/CHANGES.txt?rev=1036990&r1=1036989&r2=1036990&view=diff
==============================================================================
--- pig/branches/branch-0.8/CHANGES.txt (original)
+++ pig/branches/branch-0.8/CHANGES.txt Fri Nov 19 19:52:01 2010
@@ -207,6 +207,8 @@ PIG-1309: Map-side Cogroup (ashutoshc)
 
 BUG FIXES
 
+PIG-1719: New logical plan: FieldSchema generation for BinCond is wrong (daijy)
+
 PIG-1720: java.lang.NegativeArraySizeException during Quicksort (thejas)
 
 PIG-1715: pig-withouthadoop.jar missing automaton.jar (thejas)

Modified: pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/BinCondExpression.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/BinCondExpression.java?rev=1036990&r1=1036989&r2=1036990&view=diff
==============================================================================
--- pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/BinCondExpression.java
(original)
+++ pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/BinCondExpression.java
Fri Nov 19 19:52:01 2010
@@ -97,7 +97,7 @@ public class BinCondExpression extends L
     public LogicalSchema.LogicalFieldSchema getFieldSchema() throws FrontendException {
         if (fieldSchema!=null)
             return fieldSchema;
-        fieldSchema = new LogicalSchema.LogicalFieldSchema(null, null, getLhs().getType());
+        fieldSchema = getLhs().getFieldSchema().deepCopy();
         uidOnlyFieldSchema = fieldSchema.mergeUid(uidOnlyFieldSchema);
         return fieldSchema;
     }

Modified: pig/branches/branch-0.8/test/org/apache/pig/test/TestEvalPipeline2.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.8/test/org/apache/pig/test/TestEvalPipeline2.java?rev=1036990&r1=1036989&r2=1036990&view=diff
==============================================================================
--- pig/branches/branch-0.8/test/org/apache/pig/test/TestEvalPipeline2.java (original)
+++ pig/branches/branch-0.8/test/org/apache/pig/test/TestEvalPipeline2.java Fri Nov 19 19:52:01
2010
@@ -803,4 +803,20 @@ public class TestEvalPipeline2 extends T
         
         assertFalse(iter.hasNext());
     }
+    
+    // See PIG-1719
+    @Test
+    public void testBinCondSchema() throws IOException {
+        String[] inputData = new String[] {"hello world\t2"};
+        Util.createInputFile(cluster, "table_testSchemaSerialization.txt", inputData);
+        pigServer.registerQuery("a = load 'table_testSchemaSerialization.txt' as (a0:chararray,
a1:int);");
+        pigServer.registerQuery("b = foreach a generate FLATTEN((a1<=1?{('null')}:TOKENIZE(a0)));");
+        pigServer.registerQuery("c = foreach b generate UPPER($0);");
+        
+        Iterator<Tuple> it = pigServer.openIterator("c");
+        Tuple t = it.next();
+        assertTrue(t.get(0).equals("HELLO"));
+        t = it.next();
+        assertTrue(t.get(0).equals("WORLD"));
+    }
 }



Mime
View raw message