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 5834618D91 for ; Wed, 9 Dec 2015 05:49:59 +0000 (UTC) Received: (qmail 10176 invoked by uid 500); 9 Dec 2015 05:49:59 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 10128 invoked by uid 500); 9 Dec 2015 05:49:59 -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 10112 invoked by uid 99); 9 Dec 2015 05:49:58 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2015 05:49:58 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 72B58291A4F; Wed, 9 Dec 2015 05:49:58 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8251647372901045855==" MIME-Version: 1.0 Subject: Re: Review Request 40743: PIG-4709 Improve performance of GROUPBY operator on Spark From: "Pallavi Rao" To: "Xuefu Zhang" , "Mohit Sabharwal" Cc: "pig" , "Xuefu Zhang" , "Pallavi Rao" , "kelly zhang" Date: Wed, 09 Dec 2015 05:49:58 -0000 Message-ID: <20151209054958.1619.97854@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Pallavi Rao" X-ReviewGroup: pig X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/40743/ X-Sender: "Pallavi Rao" References: <20151208052613.31129.80038@reviews.apache.org> In-Reply-To: <20151208052613.31129.80038@reviews.apache.org> Reply-To: "Pallavi Rao" X-ReviewRequest-Repository: pig-git --===============8251647372901045855== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/40743/ ----------------------------------------------------------- (Updated Dec. 9, 2015, 5:49 a.m.) Review request for pig, Mohit Sabharwal and Xuefu Zhang. Changes ------- Removed LogicalPlanGenerator.g changes. Bugs: PIG-4709 https://issues.apache.org/jira/browse/PIG-4709 Repository: pig-git Description ------- Currently, the GROUPBY operator of PIG is mapped by Spark's CoGroup. When the grouped data is consumed by subsequent operations to perform algebraic operations, this is sub-optimal as there is lot of shuffle traffic. The Spark Plan must be optimized to use reduceBy, where possible, so that a combiner is used. Introduced a combiner optimizer that does the following: // Checks for algebraic operations and if they exist. // Replaces global rearrange (cogroup) with reduceBy as follows: // Input: // foreach (using algebraicOp) // -> packager // -> globalRearrange // -> localRearrange // Output: // foreach (using algebraicOp.Final) // -> reduceBy (uses algebraicOp.Intermediate) // -> foreach (using algebraicOp.Initial) // -> localRearrange Diffs (updated) ----- src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POForEach.java f8c1658 src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/PORollupHIIForEach.java aca347d src/org/apache/pig/backend/hadoop/executionengine/spark/SparkLauncher.java a4dbadd src/org/apache/pig/backend/hadoop/executionengine/spark/converter/GlobalRearrangeConverter.java 5f74992 src/org/apache/pig/backend/hadoop/executionengine/spark/converter/LocalRearrangeConverter.java 9ce0492 src/org/apache/pig/backend/hadoop/executionengine/spark/converter/PigSecondaryKeyComparatorSpark.java PRE-CREATION src/org/apache/pig/backend/hadoop/executionengine/spark/converter/PreCombinerLocalRearrangeConverter.java PRE-CREATION src/org/apache/pig/backend/hadoop/executionengine/spark/converter/ReduceByConverter.java PRE-CREATION src/org/apache/pig/backend/hadoop/executionengine/spark/operator/POReduceBySpark.java PRE-CREATION src/org/apache/pig/backend/hadoop/executionengine/spark/optimizer/SparkCombinerOptimizer.java PRE-CREATION src/org/apache/pig/backend/hadoop/executionengine/util/CombinerOptimizerUtil.java 6b66ca1 src/org/apache/pig/backend/hadoop/executionengine/util/SecondaryKeyOptimizerUtil.java 546d91e test/org/apache/pig/test/TestCombiner.java df44293 Diff: https://reviews.apache.org/r/40743/diff/ Testing ------- The patch unblocked one UT in TestCombiner. Added another UT in the same class. Also did some manual testing. Thanks, Pallavi Rao --===============8251647372901045855==--