摘要:
distinct的底层使用reducebykey巧妙实现去重逻辑 //使用reduceByKey或者groupbykey的shuffle去重思想rdd.map(key=>(key,null)).reduceByKey((key,value)=>key) .map(_._1) 阅读全文
摘要:
从源码看: reduceBykey与groupbykey: 都调用函数combineByKeyWithClassTag[V]((v: V) => v, func, func, partitioner)reduceBykey的map端进行聚合combine操作mapSideCombine = true 阅读全文