reduce,aggregate和groupBy

官网说明:

groupBy:
This operation may be very expensive. If you are grouping in order to perform an
aggregation (such as a sum or average) over each key, using `PairRDDFunctions.aggregateByKey`
or `PairRDDFunctions.reduceByKey` will provide much better performance.
尽量用 reduce或者 aggregate代替groupBy操作




猜你喜欢

转载自blog.csdn.net/kaaosidao/article/details/78551394