Commit c5317d95 authored by 张彦钊's avatar 张彦钊

把刚才修改的文件回滚

parent 680b4c83
...@@ -52,7 +52,7 @@ object Recommendation_strategy_all { ...@@ -52,7 +52,7 @@ object Recommendation_strategy_all {
val stat_date = GmeiConfig.getMinusNDate(1) val stat_date = GmeiConfig.getMinusNDate(1)
// val stat_date = param.date // val stat_date = param.date
//println(param.date) //println(param.date)
val partition_date = stat_date.replace("-","") val partition_date = stat_date.replace("-","")
val decive_id_oldUser = sc.sql( val decive_id_oldUser = sc.sql(
...@@ -83,7 +83,7 @@ object Recommendation_strategy_all { ...@@ -83,7 +83,7 @@ object Recommendation_strategy_all {
|and jd.device_id not in (select device_id from blacklist) |and jd.device_id not in (select device_id from blacklist)
|and jd.stat_date ='${stat_date}' |and jd.stat_date ='${stat_date}'
""".stripMargin """.stripMargin
) )
val imp_count_oldUser_Contrast = sc.sql( val imp_count_oldUser_Contrast = sc.sql(
s""" s"""
...@@ -95,7 +95,7 @@ object Recommendation_strategy_all { ...@@ -95,7 +95,7 @@ object Recommendation_strategy_all {
|and je.device_id not in (select device_id from blacklist) |and je.device_id not in (select device_id from blacklist)
|and je.stat_date ='${stat_date}' |and je.stat_date ='${stat_date}'
""".stripMargin """.stripMargin
) )
val clk_count_oldUser_all = sc.sql( val clk_count_oldUser_all = sc.sql(
s""" s"""
...@@ -119,7 +119,7 @@ object Recommendation_strategy_all { ...@@ -119,7 +119,7 @@ object Recommendation_strategy_all {
""".stripMargin """.stripMargin
) )
//获取策略命中用户device_id //获取策略命中用户device_id
val device_id_cover = sc.sql( val device_id_cover = sc.sql(
s""" s"""
|select distinct(device_id) as device_id |select distinct(device_id) as device_id
...@@ -183,13 +183,13 @@ object Recommendation_strategy_all { ...@@ -183,13 +183,13 @@ object Recommendation_strategy_all {
""".stripMargin """.stripMargin
) )
val result1 = clk_count_oldUser_Contrast.join(imp_count_oldUser_Contrast,"stat_date") val result1 = clk_count_oldUser_Contrast.join(imp_count_oldUser_Contrast,"stat_date")
.join(clk_count_oldUser_all,"stat_date") .join(clk_count_oldUser_all,"stat_date")
.join(imp_count_oldUser_all,"stat_date") .join(imp_count_oldUser_all,"stat_date")
.join(clk_count_oldUser_Cover,"stat_date") .join(clk_count_oldUser_Cover,"stat_date")
.join(imp_count_oldUser_Cover,"stat_date") .join(imp_count_oldUser_Cover,"stat_date")
.join(device_num_cover,"stat_date") .join(device_num_cover,"stat_date")
.join(device_num_1_hit,"stat_date") .join(device_num_1_hit,"stat_date")
.join(device_num_hit,"stat_date") .join(device_num_hit,"stat_date")
result1.show() result1.show()
GmeiConfig.writeToJDBCTable(result1, "Recommendation_strategy_temp", SaveMode.Append) GmeiConfig.writeToJDBCTable(result1, "Recommendation_strategy_temp", SaveMode.Append)
...@@ -287,7 +287,7 @@ object Recommendation_strategy_all { ...@@ -287,7 +287,7 @@ object Recommendation_strategy_all {
GmeiConfig.writeToJDBCTable(result2, "strategy_other", SaveMode.Append) GmeiConfig.writeToJDBCTable(result2, "strategy_other", SaveMode.Append)
//统计新用户点击率 //统计新用户点击率
val devicee_id_newUser = sc.sql( val devicee_id_newUser = sc.sql(
s""" s"""
|select distinct(device_id) as device_id |select distinct(device_id) as device_id
...@@ -442,7 +442,7 @@ object Gini_coefficient { ...@@ -442,7 +442,7 @@ object Gini_coefficient {
""".stripMargin """.stripMargin
) )
agency_id.createOrReplaceTempView("agency_id") agency_id.createOrReplaceTempView("agency_id")
//统计次数 //统计次数
val diary_clk_num = sc.sql( val diary_clk_num = sc.sql(
s""" s"""
|select temp1.diary_id as diary_id,count(ov.cl_id) as diary_clk_num |select temp1.diary_id as diary_id,count(ov.cl_id) as diary_clk_num
...@@ -468,3 +468,4 @@ object Gini_coefficient { ...@@ -468,3 +468,4 @@ object Gini_coefficient {
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