儘量使用reduceByKey代替groupByKey

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