采用groupByKey来。将资料按照Key值重新排序。
reduceByKey能够直接将资料根据key值聚合,减少多余的交换(shuffle)动作。
避免使用groupbykey,如果数据量过大,会造成内存溢出。