Commit cff45bfa authored by 魏艺敏's avatar 魏艺敏

add daily_content_data codes

parent f7daea9b
...@@ -191,7 +191,7 @@ LEFT JOIN ...@@ -191,7 +191,7 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL WHERE spam_pv.device_id IS NULL
...@@ -275,7 +275,7 @@ LEFT JOIN ...@@ -275,7 +275,7 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL WHERE spam_pv.device_id IS NULL
...@@ -345,10 +345,9 @@ LEFT JOIN ...@@ -345,10 +345,9 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL
LEFT JOIN LEFT JOIN
(--活跃设备 (--活跃设备
SELECT device_id SELECT device_id
...@@ -358,7 +357,7 @@ LEFT JOIN ...@@ -358,7 +357,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','') AND partition_date < regexp_replace((current_date),'-','')
)t3 )t3
ON t2.cl_id=t3.device_id ON t2.cl_id=t3.device_id
WHERE spam_pv.cl_id IS NULL WHERE spam_pv.device_id IS NULL
)t4 )t4
LATERAL VIEW explode(t4.channel) t5 AS channel LATERAL VIEW explode(t4.channel) t5 AS channel
GROUP BY regexp_replace(partition_date,'-',''),device_type,active_type,t5.channel GROUP BY regexp_replace(partition_date,'-',''),device_type,active_type,t5.channel
...@@ -423,7 +422,7 @@ LEFT JOIN ...@@ -423,7 +422,7 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
LEFT JOIN LEFT JOIN
...@@ -436,7 +435,7 @@ LEFT JOIN ...@@ -436,7 +435,7 @@ LEFT JOIN
)t3 )t3
on t2.partition_date=t3.partition_date on t2.partition_date=t3.partition_date
AND t2.cl_id=t3.device_id AND t2.cl_id=t3.device_id
WHERE spam_pv.cl_id IS NULL WHERE spam_pv.device_id IS NULL
)t4 )t4
LATERAL VIEW explode(t4.channel) t5 AS channel LATERAL VIEW explode(t4.channel) t5 AS channel
GROUP BY partition_date,device_type,active_type,t5.channel GROUP BY partition_date,device_type,active_type,t5.channel
...@@ -578,7 +577,7 @@ LEFT JOIN ...@@ -578,7 +577,7 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL WHERE spam_pv.device_id IS NULL
...@@ -728,7 +727,7 @@ LEFT JOIN ...@@ -728,7 +727,7 @@ LEFT JOIN
group by a.partition_date,user_id group by a.partition_date,user_id
)t4 )t4
on t3.user_id=t4.user_id on t3.user_id=t4.user_id
and t3.reply_date=t4.partition_date and t3.create_date=t4.partition_date
LEFT JOIN LEFT JOIN
...@@ -1051,7 +1050,7 @@ LEFT JOIN ...@@ -1051,7 +1050,7 @@ LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV ( -- 去掉疑似机构刷量的PV和UV
select distinct device_id select distinct device_id
from ml.ml_d_ct_dv_devicespam_d from ml.ml_d_ct_dv_devicespam_d
where partition_day='${partition_date}' where partition_day=regexp_replace((current_date - interval '1' day),'-','')
)spam_pv )spam_pv
on t2.cl_id=spam_pv.device_id on t2.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL WHERE spam_pv.device_id IS NULL
......
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