Commit 0851ce88 authored by 高雅喆's avatar 高雅喆

add sortbykey

parent 3bb3f446
......@@ -656,7 +656,8 @@ object GetLevelCount {
println(diary_level1.count())
val level1_count = diary_level1.rdd.map(x => (x(1).toString)).map(level1 => (level1,1)).reduceByKey((a,b) => a+b).map(p => (p._1,p._2)).sortByKey(false,2)
level1_count.collect()
level1_count.collect().foreach(println)
println(level1_count.count())
sc.stop()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment