Commit ad022ce6 authored by 高雅喆's avatar 高雅喆

add sortbykey

parent 99d95ed7
......@@ -655,7 +655,7 @@ object GetLevelCount {
diary_level1.show()
println(diary_level1.count())
val cid_xiong = diary_level1.rdd.filter(_.getAs("level1_id")==7)
val cid_xiong = diary_level1.rdd.filter(_.getAs("level1_id")=="7")
cid_xiong.collect().foreach(println)
val level1_count = diary_level1.rdd.map(x => (x(1).toString)).map(level1 => (level1,1)).reduceByKey((a,b) => a+b).sortBy(_._2,false)
......
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