Commit aa619a16 authored by litaolemo's avatar litaolemo

update

parent 0836ca0f
......@@ -147,7 +147,8 @@ for t in range(1, task_days):
GROUP BY cl_id,partition_date
)t2
ON t1.partition_day=t2.partition_date AND t1.device_id=t2.cl_id
left join
)exp
left join
(
SELECT DISTINCT device_id
FROM ml.ml_d_ct_dv_devicespam_d --去除机构刷单设备,即作弊设备(浏览和曝光事件去除)
......@@ -157,7 +158,7 @@ for t in range(1, task_days):
SELECT DISTINCT device_id
FROM dim.dim_device_user_staff --去除内网用户
)spam_pv
on spam_pv.device_id=t1.device_id
on spam_pv.device_id=exp.device_id
LEFT JOIN
(
SELECT partition_date,device_id
......@@ -208,10 +209,9 @@ for t in range(1, task_days):
on t1.user_id=t2.user_id
group by partition_date,device_id
)dev
on t1.device_id=dev.device_id
WHERE (t1.device_id IS NULL or t1.device_id = '')
on exp.device_id=dev.device_id
WHERE (exp.device_id IS NULL or exp.device_id = '')
and (dev.device_id is null or dev.device_id='')
)exp
JOIN
(
SELECT partition_date,device_id,t2.active_type,t2.channel,t2.device_os_type
......@@ -276,4 +276,4 @@ for t in range(1, task_days):
db.commit()
print(res)
# cursor.executemany()
db.close()
# db.close()
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