您当前的位置: 首页 >  ar

段智华

暂无认证

  • 0浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

第148讲:Spark RDD中Transformation的combineByKey、reduceByKey详解

段智华 发布时间:2017-05-06 08:54:31 ,浏览量:0

第148讲:Spark RDD中Transformation的combineByKey、reduceByKey详解

我们看一下PairRDDFunctions.scala的reduceByKey:类似于Hadoop中combiner,reduceByKey在每一个mapper进行本地合并,合并以后才把结果发送给reduce。他调用的其实就是combineByKey。

/**
 * Merge the values for each key using an associative and commutative reduce function. This will
 * also perform the merging locally on each mapper before sending results to a reducer, similarly
 * to a "combiner" in MapReduce.
 */
def reduceByKey(partitioner: Partitioner, func: (
关注
打赏
1659361485
查看更多评论
立即登录/注册

微信扫码登录

0.0617s