Commit 29b337f4 authored by 王志伟's avatar 王志伟

彦钊统计指定城市的ctr

parent ba56e976
......@@ -75,7 +75,7 @@ object temp_count {
val clk_count_oldUser = sc.sql(
s"""
|select '${stat_date}' as stat_date, count(cid_id) as clk_count_oldUser_Contrast
|select '${stat_date}' as stat_date, count(jd.cid_id) as clk_count_oldUser
|from data_feed_click jd inner join device_id_old
|on jd.device_id = device_id_old.device_id
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
......@@ -87,7 +87,7 @@ object temp_count {
val imp_count_oldUser = sc.sql(
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
|from data_feed_exposure je inner join device_id_old
|on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary'
......@@ -99,9 +99,9 @@ object temp_count {
val clk_count_all = sc.sql(
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_all
|from data_feed_click
|where (jd.cid_type = 'diary' or jd.cid_type = 'diary_video')
|where (cid_type = 'diary' or cid_type = 'diary_video')
|and device_id not in (select device_id from blacklist)
|and city_id in ("huzhou","liuan","zhenjiang","taizhou","jiaxing","weihai","maanshan","changzhou","shantou","nantong","yantai","wuxi","huhehaote","taiyuan","xining","yinchuan")
|and stat_date ='${stat_date}'
......@@ -110,7 +110,7 @@ object temp_count {
val imp_count__all = sc.sql(
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_all
|from data_feed_exposure
|where cid_type = 'diary'
|and device_id not in (select device_id from blacklist)
......
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