Return-Path: X-Original-To: apmail-pig-dev-archive@www.apache.org Delivered-To: apmail-pig-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ADFE3107BF for ; Thu, 1 Aug 2013 22:21:49 +0000 (UTC) Received: (qmail 40589 invoked by uid 500); 1 Aug 2013 22:21:49 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 40550 invoked by uid 500); 1 Aug 2013 22:21:49 -0000 Mailing-List: contact dev-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 dev@pig.apache.org Received: (qmail 40541 invoked by uid 500); 1 Aug 2013 22:21:49 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 40538 invoked by uid 99); 1 Aug 2013 22:21:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 22:21:49 +0000 Date: Thu, 1 Aug 2013 22:21:49 +0000 (UTC) From: "Cheolsoo Park (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PIG-3395) Large filter expression makes Pig hang MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PIG-3395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Cheolsoo Park updated PIG-3395: ------------------------------- Resolution: Fixed Status: Resolved (was: Patch Available) Thank you Rohini for the review! Committed it to trunk. I fixed all the white space problems in PColFilterExtractor.java (trailing white spaces and tabs), so it should be easy on the eyes now. > Large filter expression makes Pig hang > -------------------------------------- > > Key: PIG-3395 > URL: https://issues.apache.org/jira/browse/PIG-3395 > Project: Pig > Issue Type: Bug > Components: impl > Reporter: Cheolsoo Park > Assignee: Cheolsoo Park > Fix For: 0.12 > > Attachments: PIG-3395-2.patch, PIG-3395.patch, thread_dump.txt > > > Currently, partition filter push down is quite costly. For example, if you have many nested or/and expressions, Pig hangs: > {code} > base = load '' using MyStorage(); > filt = filter base by > (dateint == 20130719 and batchid == 'merged_1' and hour IN (19,20,21,22,23)) > or > (dateint == 20130720 and batchid == 'merged_1' and hour IN (0,1,2,3,4,5,6,7,8)) > or > (dateint == 20130720 and batchid == 'merged_2' and hour == 7) > or > (dateint == 20130720 and batchid == 'merged_1' and hour IN (9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)) > or > (dateint == 20130721 and batchid == 'merged_1' and hour IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)) > or > (dateint == 20130722 and batchid == 'merged_1' and hour IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)); > dump filt; > {code} > Note that IN operator is converted to nested OR's by Pig parser. > Looking at the thread dump, I found it creates almost 60 stack frames and makes JVM suffer. (I will attach full stack trace.) > {code} > > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:504) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:237) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:504) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:214) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:504) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:211) > at org.apache.pig.newplan.PColFilterExtractor.visit(PColFilterExtractor.java:108) > {code} > Although the filter expression can be simplified, it seems possible to make PColFilterExtractor more efficient. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira