pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1148107 - in /pig/branches/branch-0.8: CHANGES.txt src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.java test/org/apache/pig/test/TestEvalPipeline2.java
Date Mon, 18 Jul 2011 23:50:28 GMT
Author: daijy
Date: Mon Jul 18 23:50:27 2011
New Revision: 1148107

URL: http://svn.apache.org/viewvc?rev=1148107&view=rev
Log:
PIG-2077: Project UDF output inside a non-foreach statement fail on 0.8

Modified:
    pig/branches/branch-0.8/CHANGES.txt
    pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.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=1148107&r1=1148106&r2=1148107&view=diff
==============================================================================
--- pig/branches/branch-0.8/CHANGES.txt (original)
+++ pig/branches/branch-0.8/CHANGES.txt Mon Jul 18 23:50:27 2011
@@ -36,6 +36,8 @@ PIG-1886: Add zookeeper jar to list of j
 
 BUG FIXES
 
+PIG-2077: Project UDF output inside a non-foreach statement fail on 0.8 (daijy)
+
 PIG-2067: FilterLogicExpressionSimplifier removed some branches in some cases (daijy)
 
 PIG-2033: Pig returns sucess for the failed Pig script (rding)

Modified: pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.java?rev=1148107&r1=1148106&r2=1148107&view=diff
==============================================================================
--- pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.java
(original)
+++ pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/LogicalExpPlanMigrationVistor.java
Mon Jul 18 23:50:27 2011
@@ -134,7 +134,7 @@ public class LogicalExpPlanMigrationVist
         
         LogicalExpression pe;
         if (project.getPlan().getPredecessors(project)!=null && project.getPlan().getPredecessors(project).get(0)
-                instanceof LOProject) {
+                instanceof ExpressionOperator) {
             List<Integer> columnNums = new ArrayList<Integer>();
             columnNums.add(col);
             pe = new DereferenceExpression(exprPlan, columnNums);

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=1148107&r1=1148106&r2=1148107&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 Mon Jul 18 23:50:27
2011
@@ -1287,4 +1287,26 @@ public class TestEvalPipeline2 extends T
         assertTrue(t.toString().equals("({(1)})"));
         assertFalse(iter.hasNext());
     }
+    
+    @Test
+    public void testDereferenceUDFNonForEach() throws Exception {
+        String[] input1 = {
+                "1\t2011/3/2"
+        };
+        String[] input2 = {
+                "1\t2011/3/2 12:32"
+        };
+        
+        Util.createInputFile(cluster, "table_testDereferenceUDFNonForEach1", input1);
+        Util.createInputFile(cluster, "table_testDereferenceUDFNonForEach2", input2);
+        pigServer.registerQuery("A = load 'table_testDereferenceUDFNonForEach1' as (tracking_id,
day:chararray);");
+        pigServer.registerQuery("B = load 'table_testDereferenceUDFNonForEach2' as (tracking_id,
timestamp:chararray);");
+        pigServer.registerQuery("C = JOIN A by (tracking_id, day) LEFT OUTER, B by (tracking_id,
 STRSPLIT(timestamp, ' ').$0);");
+        
+        Iterator<Tuple> iter = pigServer.openIterator("C");
+        
+        Tuple t = iter.next();
+        assertTrue(t.toString().equals("(1,2011/3/2,1,2011/3/2 12:32)"));
+        assertFalse(iter.hasNext());
+    }
 }



Mime
View raw message