pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From knogu...@apache.org
Subject svn commit: r1808926 - in /pig/trunk: CHANGES.txt src/org/apache/pig/newplan/FilterExtractor.java test/org/apache/pig/test/TestNewPartitionFilterPushDown.java
Date Tue, 19 Sep 2017 18:27:13 GMT
Author: knoguchi
Date: Tue Sep 19 18:27:13 2017
New Revision: 1808926

URL: http://svn.apache.org/viewvc?rev=1808926&view=rev
Log:
PIG-5299: PartitionFilterOptimizer failing at compile time (knoguchi)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/newplan/FilterExtractor.java
    pig/trunk/test/org/apache/pig/test/TestNewPartitionFilterPushDown.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1808926&r1=1808925&r2=1808926&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Sep 19 18:27:13 2017
@@ -48,6 +48,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-5299: PartitionFilterOptimizer failing at compile time (knoguchi)
+
 PIG-5290: User Cache upload contention can cause job failures (xkrogen via rohini)
 
 PIG-5293: Suspicious code as missing `this' for a member (lifove via daijy)

Modified: pig/trunk/src/org/apache/pig/newplan/FilterExtractor.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/newplan/FilterExtractor.java?rev=1808926&r1=1808925&r2=1808926&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/newplan/FilterExtractor.java (original)
+++ pig/trunk/src/org/apache/pig/newplan/FilterExtractor.java Tue Sep 19 18:27:13 2017
@@ -334,7 +334,12 @@ public abstract class FilterExtractor {
 
         for( Operator succ : children ) {
             filteredPlan.disconnect( op, succ );
-            removeFromFilteredPlan( succ );
+            // check if this successor has any other predecessor.
+            // if none, proceed with the removal.
+            List<Operator> predsOfsucc = filteredPlan.getPredecessors( succ );
+            if( predsOfsucc == null || predsOfsucc.size() == 0 ) {
+                removeFromFilteredPlan( succ );
+            }
         }
 
         filteredPlan.remove( op );

Modified: pig/trunk/test/org/apache/pig/test/TestNewPartitionFilterPushDown.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestNewPartitionFilterPushDown.java?rev=1808926&r1=1808925&r2=1808926&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestNewPartitionFilterPushDown.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestNewPartitionFilterPushDown.java Tue Sep 19 18:27:13
2017
@@ -721,6 +721,13 @@ public class TestNewPartitionFilterPushD
         testFull(q, "(srcid != 10)", "(srcid == z.z1)", true);
     }
 
+    @Test
+    public void testNegativeOrAndOr() throws Exception {
+        String q = query + "b = filter a by dstid != 10 OR ((dstid < 3000 and srcid ==
1000) OR (dstid >= 3000 and srcid == 2000));" +
+                   "store b into 'out';";
+        test(q, Arrays.asList("srcid"), null, "((dstid != 10) or (((dstidLessThan3000) and
(srcid == 1000)) or ((dstidGreaterThanEqual3000) and (srcid == 2000))))", true);
+    }
+
     //// helper methods ///////
     private PartitionFilterExtractor test(String query, List<String> partitionCols,
             String expPartFilterString, String expFilterString)



Mime
View raw message