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

修复bug

parent 649772e4
...@@ -79,7 +79,7 @@ object find_bug { ...@@ -79,7 +79,7 @@ object find_bug {
val clk_count_oldUser_Contrast = sc.sql( val clk_count_oldUser_Contrast = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as clk_count_oldUser_Contrast |select '${stat_date}' as stat_date, count(cid_id) as clk_count_oldUser_Contrast
|from data_feed_click jd inner join device_id_old |from jerry_prod.data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id |on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id regexp'1$$' |and jd.device_id regexp'1$$'
...@@ -93,7 +93,7 @@ object find_bug { ...@@ -93,7 +93,7 @@ object find_bug {
val imp_count_oldUser_Contrast = sc.sql( val imp_count_oldUser_Contrast = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_Contrast |select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_Contrast
|from data_feed_exposure je inner join device_id_old |from jerry_prod.data_feed_exposure je inner join device_id_old
|on je.device_id = device_id_old.device_id |on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id regexp'1$$' |and je.device_id regexp'1$$'
...@@ -107,7 +107,7 @@ object find_bug { ...@@ -107,7 +107,7 @@ object find_bug {
val clk_count_oldUser_all = sc.sql( val clk_count_oldUser_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as clk_count_oldUser_all |select '${stat_date}' as stat_date, count(cid_id) as clk_count_oldUser_all
|from data_feed_click jd inner join device_id_old |from jerry_prod.data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id |on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id not in (select device_id from blacklist) |and jd.device_id not in (select device_id from blacklist)
...@@ -119,7 +119,7 @@ object find_bug { ...@@ -119,7 +119,7 @@ object find_bug {
val imp_count_oldUser_all = sc.sql( val imp_count_oldUser_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_all |select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_all
|from data_feed_exposure je inner join device_id_old |from jerry_prod.data_feed_exposure je inner join device_id_old
|on je.device_id = device_id_old.device_id |on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id not in (select device_id from blacklist) |and je.device_id not in (select device_id from blacklist)
...@@ -148,7 +148,7 @@ object find_bug { ...@@ -148,7 +148,7 @@ object find_bug {
val clk_active_1 = sc.sql( val clk_active_1 = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(jd.cid_id) as clk_active_1 |select '${stat_date}' as stat_date, count(jd.cid_id) as clk_active_1
|from data_feed_click jd inner join device_id_old |from jerry_prod.data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id |on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id regexp'1$$' |and jd.device_id regexp'1$$'
...@@ -162,7 +162,7 @@ object find_bug { ...@@ -162,7 +162,7 @@ object find_bug {
val imp_active_1 = sc.sql( val imp_active_1 = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(je.cid_id) as imp_active_1 |select '${stat_date}' as stat_date, count(je.cid_id) as imp_active_1
|from data_feed_exposure je inner join device_id_old |from jerry_prod.data_feed_exposure je inner join device_id_old
|on je.device_id = device_id_old.device_id |on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id in (select distinct(device_id) from data_feed_click where device_id regexp '1$$' and stat_date = '${stat_date}') |and je.device_id in (select distinct(device_id) from data_feed_click where device_id regexp '1$$' and stat_date = '${stat_date}')
...@@ -176,7 +176,7 @@ object find_bug { ...@@ -176,7 +176,7 @@ object find_bug {
val clk_diary_device = sc.sql( val clk_diary_device = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(distinct(jd.device_id)) as clk_diary_device |select '${stat_date}' as stat_date, count(distinct(jd.device_id)) as clk_diary_device
|from data_feed_click jd inner join device_id_old |from jerry_prod.data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id |on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id regexp'1$$' |and jd.device_id regexp'1$$'
...@@ -190,7 +190,7 @@ object find_bug { ...@@ -190,7 +190,7 @@ object find_bug {
val clk_active_all = sc.sql( val clk_active_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(jd.cid_id) as clk_active_all |select '${stat_date}' as stat_date, count(jd.cid_id) as clk_active_all
|from data_feed_click jd inner join device_id_old |from jerry_prod.data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id |on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id not in (select device_id from blacklist) |and jd.device_id not in (select device_id from blacklist)
...@@ -203,7 +203,7 @@ object find_bug { ...@@ -203,7 +203,7 @@ object find_bug {
val imp_active_all = sc.sql( val imp_active_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(je.cid_id) as imp_active_all |select '${stat_date}' as stat_date, count(je.cid_id) as imp_active_all
|from data_feed_exposure je inner join device_id_old |from jerry_prod.data_feed_exposure je inner join device_id_old
|on je.device_id = device_id_old.device_id |on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id in (select distinct(device_id) from data_feed_click where stat_date = '${stat_date}') |and je.device_id in (select distinct(device_id) from data_feed_click where stat_date = '${stat_date}')
...@@ -217,7 +217,7 @@ object find_bug { ...@@ -217,7 +217,7 @@ object find_bug {
val clk_diary_device_cover = sc.sql( val clk_diary_device_cover = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date,count(distinct(device_id)) as clk_diary_device_cover |select '${stat_date}' as stat_date,count(distinct(device_id)) as clk_diary_device_cover
|from merge_queue_table |from jerry_prod.merge_queue_table
|where device_id in (select distinct(device_id) from data_feed_click where stat_date = '${stat_date}') |where device_id in (select distinct(device_id) from data_feed_click where stat_date = '${stat_date}')
""".stripMargin """.stripMargin
) )
...@@ -227,7 +227,7 @@ object find_bug { ...@@ -227,7 +227,7 @@ object find_bug {
val device_all_cover = sc.sql( val device_all_cover = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date,count(distinct(device_id)) as device_all_cover |select '${stat_date}' as stat_date,count(distinct(device_id)) as device_all_cover
|from merge_queue_table |from jerry_prod.merge_queue_table
""".stripMargin """.stripMargin
) )
device_all_cover.show() device_all_cover.show()
...@@ -269,11 +269,11 @@ object find_bug { ...@@ -269,11 +269,11 @@ object find_bug {
val clk_count_newUser_Contrast = sc.sql( val clk_count_newUser_Contrast = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as clk_count_newUser_Contrast |select '${stat_date}' as stat_date, count(cid_id) as clk_count_newUser_Contrast
|from data_feed_click jd inner join device_id_new |from jerry_prod.data_feed_click jd inner join device_id_new
|on jd.device_id = device_id_new.device_id |on jd.device_id = device_id_new.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id regexp'1$$' |and jd.device_id regexp'1$$'
|and jd.device_id not in (select device_id from blacklist) |and jd.device_id not in (select device_id from jerry_prod.blacklist)
|and jd.stat_date ='${stat_date}' |and jd.stat_date ='${stat_date}'
""".stripMargin """.stripMargin
) )
...@@ -282,7 +282,7 @@ object find_bug { ...@@ -282,7 +282,7 @@ object find_bug {
val imp_count_newUser_Contrast = sc.sql( val imp_count_newUser_Contrast = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_Contrast |select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_Contrast
|from data_feed_exposure je inner join device_id_new |from jerry_prod.data_feed_exposure je inner join device_id_new
|on je.device_id = device_id_new.device_id |on je.device_id = device_id_new.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id regexp'1$$' |and je.device_id regexp'1$$'
...@@ -295,10 +295,10 @@ object find_bug { ...@@ -295,10 +295,10 @@ object find_bug {
val clk_count_newUser_all = sc.sql( val clk_count_newUser_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as clk_count_newUser_all |select '${stat_date}' as stat_date, count(cid_id) as clk_count_newUser_all
|from data_feed_click jd inner join device_id_new |from jerry_prod.data_feed_click jd inner join device_id_new
|on jd.device_id = device_id_new.device_id |on jd.device_id = device_id_new.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video') |where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|and jd.device_id not in (select device_id from blacklist) |and jd.device_id not in (select device_id from jerry_prod.blacklist)
|and jd.stat_date ='${stat_date}' |and jd.stat_date ='${stat_date}'
""".stripMargin """.stripMargin
) )
...@@ -307,10 +307,10 @@ object find_bug { ...@@ -307,10 +307,10 @@ object find_bug {
val imp_count_newUser_all = sc.sql( val imp_count_newUser_all = sc.sql(
s""" s"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_all |select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_all
|from data_feed_exposure je inner join device_id_new |from jerry_prod.data_feed_exposure je inner join device_id_new
|on je.device_id = device_id_new.device_id |on je.device_id = device_id_new.device_id
|where je.cid_type = 'diary' |where je.cid_type = 'diary'
|and je.device_id not in (select device_id from blacklist) |and je.device_id not in (select device_id from jerry_prod.blacklist)
|and je.stat_date ='${stat_date}' |and je.stat_date ='${stat_date}'
""".stripMargin """.stripMargin
) )
......
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