Commit 3ee62f66 authored by 王志伟's avatar 王志伟

过滤异常数据

parent 22def35a
......@@ -80,7 +80,7 @@ object Search_keywords_count {
)
search_count.show()
val get_result =search_keywords.rdd.map(x=>catch_error(x.toString())).map((_, 1)).reduceByKey(_ + _)
val get_result =search_keywords.rdd.map(x=>try{val result=JSON.parseFull(x.toString())}catch {case e: ArithmeticException => println(e)}).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