Commit 887a2bbe authored by 王志伟's avatar 王志伟

去除机构和黑名单

parent f618a1e5
...@@ -94,6 +94,8 @@ object app_list { ...@@ -94,6 +94,8 @@ object app_list {
s""" s"""
|select * |select *
|from device_id |from device_id
|where device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
val tempp=temp.withColumn("stat_date",addCol(temp("device_id"))) val tempp=temp.withColumn("stat_date",addCol(temp("device_id")))
...@@ -202,8 +204,6 @@ object coincidence_xinyang { ...@@ -202,8 +204,6 @@ object coincidence_xinyang {
|select '${data}' as stat_date,count(distinct(device_id)) as yesterday_coincidence_num |select '${data}' as stat_date,count(distinct(device_id)) as yesterday_coincidence_num
|from device_id_coincidence |from device_id_coincidence
|where stat_date = '${data}' |where stat_date = '${data}'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
//2.每日活跃总用户数(采用曝光计算) //2.每日活跃总用户数(采用曝光计算)
...@@ -213,8 +213,6 @@ object coincidence_xinyang { ...@@ -213,8 +213,6 @@ object coincidence_xinyang {
|from data_feed_exposure |from data_feed_exposure
|where stat_date = '${yesterday}' |where stat_date = '${yesterday}'
|and device_type !='App Store' |and device_type !='App Store'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
...@@ -226,8 +224,6 @@ object coincidence_xinyang { ...@@ -226,8 +224,6 @@ object coincidence_xinyang {
|select '${data}' as stat_date,count(distinct(device_id)) as week_coincidence_num |select '${data}' as stat_date,count(distinct(device_id)) as week_coincidence_num
|from device_id_coincidence |from device_id_coincidence
|where stat_date > '${week_day}' |where stat_date > '${week_day}'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
//2.每周活跃总用户(采用曝光计算) //2.每周活跃总用户(采用曝光计算)
...@@ -237,8 +233,6 @@ object coincidence_xinyang { ...@@ -237,8 +233,6 @@ object coincidence_xinyang {
|from data_feed_exposure |from data_feed_exposure
|where stat_date > '${pre_weekday}' |where stat_date > '${pre_weekday}'
|and device_type !='App Store' |and device_type !='App Store'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
...@@ -250,8 +244,6 @@ object coincidence_xinyang { ...@@ -250,8 +244,6 @@ object coincidence_xinyang {
|select '${data}' as stat_date,count(distinct(device_id)) as month_coincidence_num |select '${data}' as stat_date,count(distinct(device_id)) as month_coincidence_num
|from device_id_coincidence |from device_id_coincidence
|where stat_date > '${month_day}' |where stat_date > '${month_day}'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
//2.0 每月活跃总用户(采用曝光计算) //2.0 每月活跃总用户(采用曝光计算)
...@@ -260,9 +252,6 @@ object coincidence_xinyang { ...@@ -260,9 +252,6 @@ object coincidence_xinyang {
|select '${data}' as stat_date,count(distinct(device_id)) as month_expoure_num |select '${data}' as stat_date,count(distinct(device_id)) as month_expoure_num
|from data_feed_exposure |from data_feed_exposure
|where stat_date > '${pre_monthday}' |where stat_date > '${pre_monthday}'
|and device_type !='App Store'
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
...@@ -284,8 +273,6 @@ object coincidence_xinyang { ...@@ -284,8 +273,6 @@ object coincidence_xinyang {
|and pay_time is not null |and pay_time is not null
|and pay_time >= '2017-11-18' |and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence) |and device_id in (select distinct(device_id) from device_id_coincidence)
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
meigou_coincidence_num.show() meigou_coincidence_num.show()
...@@ -300,8 +287,6 @@ object coincidence_xinyang { ...@@ -300,8 +287,6 @@ object coincidence_xinyang {
|and pay_time is not null |and pay_time is not null
|and pay_time >= '2017-11-18' |and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence) |and device_id in (select distinct(device_id) from device_id_coincidence)
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
meigou_pay_device.show() meigou_pay_device.show()
...@@ -314,8 +299,6 @@ object coincidence_xinyang { ...@@ -314,8 +299,6 @@ object coincidence_xinyang {
|and pay_time is not null |and pay_time is not null
|and pay_time >= '2017-11-18' |and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence) |and device_id in (select distinct(device_id) from device_id_coincidence)
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
meigou_pay_all.show() meigou_pay_all.show()
...@@ -329,8 +312,6 @@ object coincidence_xinyang { ...@@ -329,8 +312,6 @@ object coincidence_xinyang {
|and pay_time is not null |and pay_time is not null
|and pay_time >= '2017-11-18' |and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence) |and device_id in (select distinct(device_id) from device_id_coincidence)
|and device_id not in (select device_id from bl_device_list)
|and device_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
meigou_pay_device_all.show() meigou_pay_device_all.show()
...@@ -367,8 +348,6 @@ object coincidence_xinyang { ...@@ -367,8 +348,6 @@ object coincidence_xinyang {
|where partition_date > '20180101' |where partition_date > '20180101'
|and action = 'welfare_detail_click_message' |and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence) |and cl_id in (select distinct(device_id) from device_id_coincidence)
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
zixun_num_co.show() zixun_num_co.show()
...@@ -380,8 +359,6 @@ object coincidence_xinyang { ...@@ -380,8 +359,6 @@ object coincidence_xinyang {
|where partition_date > '20180101' |where partition_date > '20180101'
|and action = 'welfare_detail_click_message' |and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence) |and cl_id in (select distinct(device_id) from device_id_coincidence)
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin """.stripMargin
) )
zixun_num_co_dis.show() zixun_num_co_dis.show()
......
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