Commit aa619a16 authored by litaolemo's avatar litaolemo

update

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