尽量使用reduceByKey代替groupByKey

val words = Array( "one" , "two" , "two" , "three" , "three" , "three" ) val wordPairsRDD = sc.parallelize(words).map(word = > (word, 1 ))   val wordCountsWithReduce = wordPairsRDD    .reduceByKey( _
相关文章
相关标签/搜索