Commit d092bbd5 authored by 王志伟's avatar 王志伟

repair bug

parent cf30ea19
...@@ -53,10 +53,12 @@ object Search_keywords_count { ...@@ -53,10 +53,12 @@ object Search_keywords_count {
|and partition_date ='${partition_date}' |and partition_date ='${partition_date}'
""".stripMargin """.stripMargin
) )
search_keywords.show(100)
val get_result =search_keywords.rdd.map((_, 1)).reduceByKey(_ + _) val get_result =search_keywords.rdd.map((_, 1)).reduceByKey(_ + _)
.sortBy(_._2,true) .sortBy(_._2,false)
val temp=get_result.take(10) val temp=get_result.collect()
for (i <- 0 to 9) { for (i <- 0 to temp.length ) {
println(temp(i)) println(temp(i))
} }
......
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