Commit 61c98ad3 authored by 王志伟's avatar 王志伟

过滤异常数据

parent 31a0bfe4
......@@ -82,7 +82,7 @@ object Search_keywords_count {
)
search_count.show()
val get_result =search_keywords.rdd.map(x=>Try(JSON.parseFull(x.toString()))).filter(_.isSuccess).map((_, 1)).reduceByKey(_ + _)
val get_result =search_keywords.rdd.map(x=>Try(x.toString())).filter(_.isSuccess).map((_, 1)).reduceByKey(_ + _)
.sortBy(_._2,false)
val temp=get_result.collect()
for (i <- 0 until temp.length ) {
......
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