Return-Path: Delivered-To: apmail-hadoop-pig-commits-archive@www.apache.org Received: (qmail 12292 invoked from network); 13 Feb 2009 19:12:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2009 19:12:03 -0000 Received: (qmail 96152 invoked by uid 500); 13 Feb 2009 19:12:03 -0000 Delivered-To: apmail-hadoop-pig-commits-archive@hadoop.apache.org Received: (qmail 96136 invoked by uid 500); 13 Feb 2009 19:12:03 -0000 Mailing-List: contact pig-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pig-dev@hadoop.apache.org Delivered-To: mailing list pig-commits@hadoop.apache.org Received: (qmail 96120 invoked by uid 500); 13 Feb 2009 19:12:03 -0000 Delivered-To: apmail-incubator-pig-commits@incubator.apache.org Received: (qmail 96116 invoked by uid 99); 13 Feb 2009 19:12:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 11:12:03 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO aurora.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 19:11:59 +0000 Received: from aurora.apache.org (localhost [127.0.0.1]) by aurora.apache.org (8.13.8+Sun/8.13.8) with ESMTP id n1DJBddX017664 for ; Fri, 13 Feb 2009 19:11:39 GMT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: pig-commits@incubator.apache.org Date: Fri, 13 Feb 2009 19:11:39 -0000 Message-ID: <20090213191139.17562.26841@aurora.apache.org> Subject: [Pig Wiki] Update of "PigUserCookbook" by OlgaN X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Pig Wiki" for change notification. The following page has been changed by OlgaN: http://wiki.apache.org/pig/PigUserCookbook ------------------------------------------------------------------------------ One case where pushing filters up might not be a good idea is if the cost of applying filter is very high and only a small amount of data is filtered out. + '''Reduce Your Operator Pipeline''' + + For clarity of your script, you might choose to split your projects into several steps for instance: + + {{{ + A = load 'data' as (in: map[]); + -- get key out of the map + B = foreach A generate in#k1 as k1, in#k2 as k2; + -- concatenate the keys + C = foreach B generate CONCAT(k1, k2); + ....... + }}} + + While the example above is easier to read, you might want to consider combining the two foreach statements to improve your query performance: + + {{{ + A = load 'data' as (in: map[]); + -- concatenate the keys from the map + B = foreach A generate CONCAT(in#k1, in#k2); + .... + }}} + + The same goes for filters. + '''Drop Nulls Before a Join''' This comment only applies to pig on the types branch, as pig 0.1.0 does not have nulls.