Commit 02515080 authored by 郭羽's avatar 郭羽

个性化push指标 测试

parent b9d60d2d
...@@ -78,7 +78,9 @@ def getSql(startDay,endDay): ...@@ -78,7 +78,9 @@ def getSql(startDay,endDay):
SELECT partition_day SELECT partition_day
,push_type ,push_type
,count(a.device_id) ,count(a.device_id)
,count(a.msg_id)
,count(distinct a.device_id) ,count(distinct a.device_id)
,count(distinct a.msg_id)
FROM FROM
( (
select partition_day select partition_day
...@@ -89,18 +91,18 @@ def getSql(startDay,endDay): ...@@ -89,18 +91,18 @@ def getSql(startDay,endDay):
)a )a
JOIN JOIN
( (
select msg_id,push_type,time_stamp select msg_id,push_type
from online.tl_hdfs_push2_new_view --增量表 from online.tl_hdfs_push2_new_view --增量表
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp group by msg_id,push_type
union all union all
SELECT msg_id,regexp_replace(labels['event'], '\\s+', '') AS push_type,time_stamp SELECT msg_id,regexp_replace(labels['event'], '\\s+', '') AS push_type
FROM online.tl_hdfs_push2_task_view FROM online.tl_hdfs_push2_task_view
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND labels['event_type'] = 'push' AND labels['event_type'] = 'push'
group by msg_id,regexp_replace(labels['event'], '\\s+', ''),time_stamp group by msg_id,regexp_replace(labels['event'], '\\s+', '')
)c )c
on a.msg_id=c.msg_id on a.msg_id=c.msg_id
group by partition_day group by partition_day
......
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