You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2011/10/26 00:44:18 UTC

svn commit: r1188954 - in /pig/trunk: CHANGES.txt src/org/apache/pig/parser/LogicalPlanGenerator.g test/org/apache/pig/parser/TestLogicalPlanGenerator.java

Author: daijy
Date: Tue Oct 25 22:44:17 2011
New Revision: 1188954

URL: http://svn.apache.org/viewvc?rev=1188954&view=rev
Log:
PIG-2320: Error: "projection with nothing to reference"

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/parser/LogicalPlanGenerator.g
    pig/trunk/test/org/apache/pig/parser/TestLogicalPlanGenerator.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1188954&r1=1188953&r2=1188954&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Oct 25 22:44:17 2011
@@ -258,6 +258,12 @@ declaration (azaroth via gates)
 PIG-2019: smoketest-jar target has to depend on pigunit-jar to guarantee
 inclusion of test classes (cos via gates)
 
+Release 0.9.2 - Unreleased
+
+BUG FIXES
+
+PIG-2320: Error: "projection with nothing to reference" (daijy)
+
 Release 0.9.1 - Unreleased
 
 IMPROVEMENTS

Modified: pig/trunk/src/org/apache/pig/parser/LogicalPlanGenerator.g
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/parser/LogicalPlanGenerator.g?rev=1188954&r1=1188953&r2=1188954&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/parser/LogicalPlanGenerator.g (original)
+++ pig/trunk/src/org/apache/pig/parser/LogicalPlanGenerator.g Tue Oct 25 22:44:17 2011
@@ -454,7 +454,9 @@ scope GScope;
     $group_clause::innerFlags = new ArrayList<Boolean>();
     GROUPTYPE groupType = GROUPTYPE.REGULAR;
     SourceLocation loc = new SourceLocation( (PigParserNode)$group_clause.start );
+    int oldStatementIndex = $statement::inputIndex;
 }
+@after { $statement::inputIndex = oldStatementIndex; }
  : ^( GROUP group_item+ ( group_type { groupType = $group_type.type; ((LOCogroup)$GScope::currentOp).pinOption(LOCogroup.OPTION_GROUPTYPE); } )? partition_clause? )
    {
        $alias = builder.buildGroupOp( loc, (LOCogroup)$GScope::currentOp, $statement::alias, 
@@ -1015,6 +1017,10 @@ scope GScope;
     $join_clause::joinPlans = new MultiMap<Integer, LogicalExpressionPlan>();
     $join_clause::inputAliases = new ArrayList<String>();
     $join_clause::innerFlags = new ArrayList<Boolean>();
+    int oldStatementIndex = $statement::inputIndex;
+}
+@after {
+   $statement::inputIndex=oldStatementIndex;
 }
  : ^( JOIN join_sub_clause join_type? partition_clause? )
    {

Modified: pig/trunk/test/org/apache/pig/parser/TestLogicalPlanGenerator.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/parser/TestLogicalPlanGenerator.java?rev=1188954&r1=1188953&r2=1188954&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/parser/TestLogicalPlanGenerator.java (original)
+++ pig/trunk/test/org/apache/pig/parser/TestLogicalPlanGenerator.java Tue Oct 25 22:44:17 2011
@@ -372,5 +372,13 @@ public class TestLogicalPlanGenerator {
             "USING PigStorage ('\n');";
         generateLogicalPlan( query );
     }
+    
+    @Test
+    // See PIG-2320
+    public void testInlineOpInGroup() {
+        String query = "a = load 'data1' as (x:int); \n" +
+            "a_1 = filter (group a by x) by COUNT(a) > 0;";
+        generateLogicalPlan( query );
+    }
 
 }