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/12/04 08:06:45 UTC

svn commit: r1210058 - in /pig/branches/branch-0.9: CHANGES.txt src/org/apache/pig/PigServer.java test/e2e/pig/tests/nightly.conf

Author: daijy
Date: Sun Dec  4 07:06:44 2011
New Revision: 1210058

URL: http://svn.apache.org/viewvc?rev=1210058&view=rev
Log:
PIG-2385: Store statements not getting processed

Modified:
    pig/branches/branch-0.9/CHANGES.txt
    pig/branches/branch-0.9/src/org/apache/pig/PigServer.java
    pig/branches/branch-0.9/test/e2e/pig/tests/nightly.conf

Modified: pig/branches/branch-0.9/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/CHANGES.txt?rev=1210058&r1=1210057&r2=1210058&view=diff
==============================================================================
--- pig/branches/branch-0.9/CHANGES.txt (original)
+++ pig/branches/branch-0.9/CHANGES.txt Sun Dec  4 07:06:44 2011
@@ -31,6 +31,8 @@ PIG-2346: TypeCastInsert should not inse
 PIG-2339: HCatLoader loads all the partitions in a partitioned table even though 
  a filter clause on the partitions is specified in the Pig script (daijy)
 
+PIG-2385: Store statements not getting processed (daijy)
+
 Release 0.9.1 - Unreleased
 
 IMPROVEMENTS

Modified: pig/branches/branch-0.9/src/org/apache/pig/PigServer.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/org/apache/pig/PigServer.java?rev=1210058&r1=1210057&r2=1210058&view=diff
==============================================================================
--- pig/branches/branch-0.9/src/org/apache/pig/PigServer.java (original)
+++ pig/branches/branch-0.9/src/org/apache/pig/PigServer.java Sun Dec  4 07:06:44 2011
@@ -1276,17 +1276,17 @@ public class PigServer {
         if( jobPriority != null ) {
             pigContext.getProperties().setProperty( PigContext.JOB_PRIORITY, jobPriority );
         }
-        
-       currDAG.compile();
+       
+        // In this plan, all stores in the plan will be executed. They should be ignored if the plan is reused.
+        currDAG.countExecutedStores();
+       
+        currDAG.compile();
 
         if( currDAG.lp.size() == 0 ) {
             return PigStatsUtil.getEmptyPigStats();
         }
-
-        PigStats stats = executeCompiledLogicalPlan();
         
-        // At this point, all stores in the plan are executed. They should be ignored if the plan is reused.
-        currDAG.executed();
+        PigStats stats = executeCompiledLogicalPlan();
         
         return stats;
     }
@@ -1403,9 +1403,9 @@ public class PigServer {
         };
 
         /**
-         * Call back method for post execution processing.
+         * Call back method for counting executed stores.
          */
-        private void executed() {
+        private void countExecutedStores() {
             for( Operator sink : lp.getSinks() ) {
                 if( sink instanceof LOStore ) {
                     processedStores++;

Modified: pig/branches/branch-0.9/test/e2e/pig/tests/nightly.conf
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/tests/nightly.conf?rev=1210058&r1=1210057&r2=1210058&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/tests/nightly.conf (original)
+++ pig/branches/branch-0.9/test/e2e/pig/tests/nightly.conf Sun Dec  4 07:06:44 2011
@@ -3589,6 +3589,17 @@ store E into ':OUTPATH:';\, 
                                 C = group B all;
                                 D = foreach C generate group, COR(B.age, B.gpa, B.gpa2);
                                 store D into ':OUTPATH:';?,
+                    }, {
+                        # PIG-2385
+                        'num' => 3,
+                        'pig_params' => ['-M'],
+                        'pig' => q?A = LOAD ':INPATH:/singlefile/studenttab10k' AS (name:chararray, age:int,gpa:double);
+                                Z = group A all;
+                                Z1 = foreach Z generate AVG(A.gpa) as avg;
+                                B = foreach A generate name, age, gpa-Z1.avg as diff;
+                                STORE B INTO ':OUTPATH:.1';
+                                C = DISTINCT B ;
+                                store C into ':OUTPATH:.2';?,
                     }
                 ],
             },