GitHub user ConeyLiu opened a pull request: https://github.com/apache/spark/pull/19317
[SPARK-22098][CORE] Add new method aggregateByKeyLocally in RDD ## What changes were proposed in this pull request? https://issues.apache.org/jira/browse/SPARK-22096 NaiveBayes currently takes aggreateByKey followed by a collect to calculate frequency for each feature/label. We can implement a new function 'aggregateByKeyLocally' in RDD that merges locally on each mapper before sending results to a reducer to save one stage. We tested on NaiveBayes and see ~20% performance gain with these changes. This is a subtask of our improvement. ## How was this patch tested? New UT. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ConeyLiu/spark aggregatebykeylocally Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/19317.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19317 ---- commit 73a85dc5963ac46f181a9499deabb18da4ccc308 Author: Xianyang Liu <xianyang....@intel.com> Date: 2017-08-31T05:16:09Z add new method 'aggregateByKeyLocally' ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org