Return-Path: X-Original-To: apmail-pig-commits-archive@www.apache.org Delivered-To: apmail-pig-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF36BDB46 for ; Thu, 18 Oct 2012 23:19:49 +0000 (UTC) Received: (qmail 66808 invoked by uid 500); 18 Oct 2012 23:19:49 -0000 Delivered-To: apmail-pig-commits-archive@pig.apache.org Received: (qmail 66782 invoked by uid 500); 18 Oct 2012 23:19:49 -0000 Mailing-List: contact commits-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list commits@pig.apache.org Received: (qmail 66775 invoked by uid 99); 18 Oct 2012 23:19:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 23:19:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 23:19:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 263F823888E3 for ; Thu, 18 Oct 2012 23:19:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1399916 - 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:19:01 -0000 To: commits@pig.apache.org From: jcoveney@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121018231902.263F823888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jcoveney Date: Thu Oct 18 23:19:01 2012 New Revision: 1399916 URL: http://svn.apache.org/viewvc?rev=1399916&view=rev Log: PIG-1283: COUNT on null bag causes failure (anand 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=1399916&r1=1399915&r2=1399916&view=diff ============================================================================== --- pig/trunk/CHANGES.txt (original) +++ pig/trunk/CHANGES.txt Thu Oct 18 23:19:01 2012 @@ -40,6 +40,8 @@ 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=1399916&r1=1399915&r2=1399916&view=diff ============================================================================== --- pig/trunk/src/org/apache/pig/Expression.java (original) +++ pig/trunk/src/org/apache/pig/Expression.java Thu Oct 18 23:19:01 2012 @@ -45,6 +45,7 @@ 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=1399916&r1=1399915&r2=1399916&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:19:01 2012 @@ -58,6 +58,9 @@ public class COUNT extends EvalFunc 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=1399916&r1=1399915&r2=1399916&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:19:01 2012 @@ -571,6 +571,21 @@ 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 partitionCols,