Commit 1189a028 authored by 王志伟's avatar 王志伟

统计多天重复日记数量,增加过滤个人黑名单

parent c5885ec2
...@@ -311,7 +311,7 @@ object Repeated_content_recommendation_moreday { ...@@ -311,7 +311,7 @@ object Repeated_content_recommendation_moreday {
val now= new Date() val now= new Date()
val dateFormat = new SimpleDateFormat("yyyy-MM-dd") val dateFormat = new SimpleDateFormat("yyyy-MM-dd")
val date = dateFormat.format(now.getTime - 86400000L * 15) val date = dateFormat.format(now.getTime - 86400000L * 15)
val today=dateFormat.format(now) val yesterday=dateFormat.format(now.getTime- 86400000L)
val exp_diary = sc.sql( val exp_diary = sc.sql(
...@@ -339,7 +339,7 @@ object Repeated_content_recommendation_moreday { ...@@ -339,7 +339,7 @@ object Repeated_content_recommendation_moreday {
val fenzi = count_imp.map(x => x._2).reduce((x,y) => x+y) val fenzi = count_imp.map(x => x._2).reduce((x,y) => x+y)
val repeated_rate= fenmu / fenzi.toDouble val repeated_rate= fenmu / fenzi.toDouble
val result=List((today,repeated_rate)) val result=List((yesterday,repeated_rate))
val df_result = sc.createDataFrame(result) val df_result = sc.createDataFrame(result)
GmeiConfig.writeToJDBCTable(df_result, table = "Repeated_content_recommendation_moreday", SaveMode.Append) GmeiConfig.writeToJDBCTable(df_result, table = "Repeated_content_recommendation_moreday", SaveMode.Append)
......
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