pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcove...@apache.org
Subject svn commit: r1399920 - in /pig/trunk: ./ src/org/apache/pig/ src/org/apache/pig/builtin/ src/org/apache/pig/newplan/ test/org/apache/pig/test/
Date Thu, 18 Oct 2012 23:26:06 GMT
Author: jcoveney
Date: Thu Oct 18 23:26:05 2012
New Revision: 1399920

URL: http://svn.apache.org/viewvc?rev=1399920&view=rev
Log:
PIG-2778: Add matches operator to predicate pushdown (cheolsoo via jcoveney)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/Expression.java
    pig/trunk/src/org/apache/pig/builtin/COUNT.java
    pig/trunk/src/org/apache/pig/newplan/PColFilterExtractor.java
    pig/trunk/test/org/apache/pig/test/TestBuiltin.java
    pig/trunk/test/org/apache/pig/test/TestPartitionFilterPushDown.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Oct 18 23:26:05 2012
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-2778: Add 'matches' operator to predicate pushdown (cheolsoo via jcoveney)
+
 PIG-2966: Test failures on CentOS 6 because MALLOC_ARENA_MAX is not set (cheolsoo via sms)
 
 PIG-2794: Pig test: add utils to simplify testing on Windows (jgordon via gates)
@@ -40,8 +42,6 @@ Release 0.11.0 (unreleased)
 
 INCOMPATIBLE CHANGES
 
-PIG-1283: COUNT on null bag causes failure (anand via jcoveney)
-
 PIG-1891 Enable StoreFunc to make intelligent decision based on job success or failure (initialcontext
via gates)
 
 IMPROVEMENTS

Modified: pig/trunk/src/org/apache/pig/Expression.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/Expression.java?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/Expression.java (original)
+++ pig/trunk/src/org/apache/pig/Expression.java Thu Oct 18 23:26:05 2012
@@ -45,7 +45,6 @@ public abstract class Expression {
         OP_GE(" >= "),
         OP_LT(" < "),
         OP_LE(" <= "),
-        OP_MATCH(" matches "),
 
         //binary logical
         OP_AND(" and "),

Modified: pig/trunk/src/org/apache/pig/builtin/COUNT.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/COUNT.java?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/COUNT.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/COUNT.java Thu Oct 18 23:26:05 2012
@@ -58,9 +58,6 @@ public class COUNT extends EvalFunc<Long
     public Long exec(Tuple input) throws IOException {
         try {
             DataBag bag = (DataBag)input.get(0);
-            if(bag==null)
-                return null;
-
             Iterator it = bag.iterator();
             long cnt = 0;
             while (it.hasNext()){

Modified: pig/trunk/src/org/apache/pig/newplan/PColFilterExtractor.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/newplan/PColFilterExtractor.java?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/newplan/PColFilterExtractor.java (original)
+++ pig/trunk/src/org/apache/pig/newplan/PColFilterExtractor.java Thu Oct 18 23:26:05 2012
@@ -461,8 +461,6 @@ public class PColFilterExtractor extends
 				return getExpression(binOp, OpType.OP_LT);
 			} else if(binOp instanceof LessThanEqualExpression) {
 				return getExpression(binOp, OpType.OP_LE);
-			} else if(binOp instanceof RegexExpression) {
-				return getExpression(binOp, OpType.OP_MATCH);
 			} else {
             logInternalErrorAndSetFlag();
 			}

Modified: pig/trunk/test/org/apache/pig/test/TestBuiltin.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestBuiltin.java?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestBuiltin.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestBuiltin.java Thu Oct 18 23:26:05 2012
@@ -18,7 +18,6 @@
 package org.apache.pig.test;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -1002,17 +1001,6 @@ public class TestBuiltin {
     }
 
     @Test
-    public void testCOUNTBagNullCheck() throws Exception{
-
-        DataBag b = null;
-        Tuple t = tupleFactory.getInstance().newTuple(b);
-
-        EvalFunc<Long> count = new COUNT();
-        assertNull(count.exec(t));
-       }
-
-
-    @Test
     public void testCount_ValidNumberOfArguments_WithoutInputSchema_One() throws Exception
{
          File inputFile = createCountInputFile();
          try {

Modified: pig/trunk/test/org/apache/pig/test/TestPartitionFilterPushDown.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestPartitionFilterPushDown.java?rev=1399920&r1=1399919&r2=1399920&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestPartitionFilterPushDown.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestPartitionFilterPushDown.java Thu Oct 18 23:26:05
2012
@@ -571,21 +571,6 @@ public class TestPartitionFilterPushDown
         Assert.assertEquals(counter, 5);
     }
 
-    /**
-     * Test PIG-2778 Add matches operator to predicate pushdown
-     * @throws Exception
-     */
-    @Test
-    public void testMatchOpPushDown() throws Exception {
-        // regexp condition on a partition col
-        String q = query + "b = filter a by name matches 'foo*';" + "store b into 'out';";
-        test(q, Arrays.asList("name"), "(name matches 'foo*')", null);
-
-        // regexp condition on a non-partition col
-        q = query + "b = filter a by name matches 'foo*';" + "store b into 'out';";
-        test(q, Arrays.asList("srcid"), null, "(name matches 'foo*')");
-    }
-
     //// helper methods ///////
 
     private PColFilterExtractor test(String query, List<String> partitionCols, 



Mime
View raw message