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

push codes

parent 72372d23
...@@ -21,46 +21,66 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d ...@@ -21,46 +21,66 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d
active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}', active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}',
dau BIGINT comment '{"chs_name":"DAU","description":"","etl":"","value":"","remark":""}', dau BIGINT comment '{"chs_name":"DAU","description":"","etl":"","value":"","remark":""}',
is_open_uv BIGINT comment '{"chs_name":"push开启设备数","description":"","etl":"","value":"","remark":""}', is_open_uv BIGINT comment '{"chs_name":"push开启设备数","description":"","etl":"","value":"","remark":""}',
push_receive_uv BIGINT comment '{"chs_name":"push接收设备数","description":"","etl":"","value":"","remark":""}',
push_receive_pv BIGINT comment '{"chs_name":"push接收人次","description":"","etl":"","value":"","remark":""}',
push_open_uv BIGINT comment '{"chs_name":"push拉起设备数","description":"","etl":"","value":"","remark":""}', push_open_uv BIGINT comment '{"chs_name":"push拉起设备数","description":"","etl":"","value":"","remark":""}',
push_open_pv BIGINT comment '{"chs_name":"push拉起人次","description":"","etl":"","value":"","remark":""}', push_open_pv BIGINT comment '{"chs_name":"push拉起人次","description":"","etl":"","value":"","remark":""}',
push_open_2_uv BIGINT comment '{"chs_name":"push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', push_open_2_uv BIGINT comment '{"chs_name":"push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
push_open_2_pv BIGINT comment '{"chs_name":"push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', push_open_2_pv BIGINT comment '{"chs_name":"push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
op_receive_uv BIGINT comment '{"chs_name":"运营push接收设备数","description":"","etl":"","value":"","remark":""}',
op_receive_pv BIGINT comment '{"chs_name":"运营push接收人次","description":"","etl":"","value":"","remark":""}',
op_push_open_uv BIGINT comment '{"chs_name":"运营push拉起设备数","description":"","etl":"","value":"","remark":""}', op_push_open_uv BIGINT comment '{"chs_name":"运营push拉起设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_pv BIGINT comment '{"chs_name":"运营push拉起人次","description":"","etl":"","value":"","remark":""}', op_push_open_pv BIGINT comment '{"chs_name":"运营push拉起人次","description":"","etl":"","value":"","remark":""}',
op_push_open_2_uv BIGINT comment '{"chs_name":"运营push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', op_push_open_2_uv BIGINT comment '{"chs_name":"运营push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_2_pv BIGINT comment '{"chs_name":"运营push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', op_push_open_2_pv BIGINT comment '{"chs_name":"运营push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起设备数","description":"","etl":"","value":"","remark":""}', xitong_receive_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push接收设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起人次","description":"","etl":"","value":"","remark":""}', xitong_receive_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push接收人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', xitong_push_open_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', xitong_push_open_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起人次","description":"","etl":"","value":"","remark":""}',
xitong_push_open_2_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
xitong_push_open_2_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
will_receive_uv BIGINT comment '{"chs_name":"意愿探索push接收设备数","description":"","etl":"","value":"","remark":""}',
will_receive_pv BIGINT comment '{"chs_name":"意愿探索push接收人次","description":"","etl":"","value":"","remark":""}',
will_push_open_uv BIGINT comment '{"chs_name":"意愿探索push拉起设备数","description":"","etl":"","value":"","remark":""}', will_push_open_uv BIGINT comment '{"chs_name":"意愿探索push拉起设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_pv BIGINT comment '{"chs_name":"意愿探索push拉起人次","description":"","etl":"","value":"","remark":""}', will_push_open_pv BIGINT comment '{"chs_name":"意愿探索push拉起人次","description":"","etl":"","value":"","remark":""}',
will_push_open_2_uv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', will_push_open_2_uv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_2_pv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', will_push_open_2_pv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
sign_receive_uv BIGINT comment '{"chs_name":"签到push接收设备数","description":"","etl":"","value":"","remark":""}',
sign_receive_pv BIGINT comment '{"chs_name":"签到push接收人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_uv BIGINT comment '{"chs_name":"签到push拉起设备数","description":"","etl":"","value":"","remark":""}', sign_push_open_uv BIGINT comment '{"chs_name":"签到push拉起设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_pv BIGINT comment '{"chs_name":"签到push拉起人次","description":"","etl":"","value":"","remark":""}', sign_push_open_pv BIGINT comment '{"chs_name":"签到push拉起人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_uv BIGINT comment '{"chs_name":"签到push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', sign_push_open_2_uv BIGINT comment '{"chs_name":"签到push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_pv BIGINT comment '{"chs_name":"签到push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', sign_push_open_2_pv BIGINT comment '{"chs_name":"签到push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
personal_receive_uv BIGINT comment '{"chs_name":"个性化push接收设备数","description":"","etl":"","value":"","remark":""}',
personal_receive_pv BIGINT comment '{"chs_name":"个性化push接收人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_uv BIGINT comment '{"chs_name":"个性化push拉起设备数","description":"","etl":"","value":"","remark":""}', personal_push_open_uv BIGINT comment '{"chs_name":"个性化push拉起设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_pv BIGINT comment '{"chs_name":"个性化push拉起人次","description":"","etl":"","value":"","remark":""}', personal_push_open_pv BIGINT comment '{"chs_name":"个性化push拉起人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_uv BIGINT comment '{"chs_name":"个性化push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', personal_push_open_2_uv BIGINT comment '{"chs_name":"个性化push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_pv BIGINT comment '{"chs_name":"个性化push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', personal_push_open_2_pv BIGINT comment '{"chs_name":"个性化push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
ctr_receive_uv BIGINT comment '{"chs_name":"ctr_push接收设备数","description":"","etl":"","value":"","remark":""}',
ctr_receive_pv BIGINT comment '{"chs_name":"ctr_push接收人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_uv BIGINT comment '{"chs_name":"ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}', ctr_push_open_uv BIGINT comment '{"chs_name":"ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_pv BIGINT comment '{"chs_name":"ctr_push拉起人次","description":"","etl":"","value":"","remark":""}', ctr_push_open_pv BIGINT comment '{"chs_name":"ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_uv BIGINT comment '{"chs_name":"ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', ctr_push_open_2_uv BIGINT comment '{"chs_name":"ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_pv BIGINT comment '{"chs_name":"ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', ctr_push_open_2_pv BIGINT comment '{"chs_name":"ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
non_ctr_receive_uv BIGINT comment '{"chs_name":"非ctr_push接收设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_receive_pv BIGINT comment '{"chs_name":"非ctr_push接收人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_uv BIGINT comment '{"chs_name":"非ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}', non_ctr_push_open_uv BIGINT comment '{"chs_name":"非ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_pv BIGINT comment '{"chs_name":"非ctr_push拉起人次","description":"","etl":"","value":"","remark":""}', non_ctr_push_open_pv BIGINT comment '{"chs_name":"非ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_uv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', non_ctr_push_open_2_uv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_pv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', non_ctr_push_open_2_pv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
AI_receive_uv BIGINT comment '{"chs_name":"AI_push接收设备数","description":"","etl":"","value":"","remark":""}',
AI_receive_pv BIGINT comment '{"chs_name":"AI_push接收人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_uv BIGINT comment '{"chs_name":"AI_push拉起设备数","description":"","etl":"","value":"","remark":""}', AI_push_open_uv BIGINT comment '{"chs_name":"AI_push拉起设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_pv BIGINT comment '{"chs_name":"AI_push拉起人次","description":"","etl":"","value":"","remark":""}', AI_push_open_pv BIGINT comment '{"chs_name":"AI_push拉起人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_uv BIGINT comment '{"chs_name":"AI_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', AI_push_open_2_uv BIGINT comment '{"chs_name":"AI_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_pv BIGINT comment '{"chs_name":"AI_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}', AI_push_open_2_pv BIGINT comment '{"chs_name":"AI_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_uv BIGINT comment '{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}', auto_receive_uv BIGINT comment '{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_pv BIGINT comment '{"chs_name":"除运营外push拉起人次","description":"","etl":"","value":"","remark":""}', auto_receive_pv BIGINT comment '{"chs_name":"除运营外push拉起人次","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}', auto_push_open_uv BIGINT comment '{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}' auto_push_open_pv BIGINT comment '{"chs_name":"除运营外push拉起人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}'
)comment 'push日报' )comment 'push日报'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期') PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED ROW FORMAT DELIMITED
......
...@@ -8,9 +8,77 @@ SET mapred.reduce.tasks=20; ...@@ -8,9 +8,77 @@ SET mapred.reduce.tasks=20;
SET role admin; SET role admin;
--push点击数据 --push点击数据
INSERT OVERWRITE TABLE pm.tl_pm_push_click_d PARTITION (PARTITION_DAY = ${partition_day}) INSERT OVERWRITE TABLE pm.tl_pm_push_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT t1.partition_date as day_id
SELECT NVL(click.partition_date,received.partition_date) as day_id
,NVL(click.device_os_type,received.device_os_type) as device_os_type
,NVL(click.active_type,received.active_type) as active_type
,dau
,is_open_uv
,push_receive_uv
,push_receive_pv
,push_open_uv
,push_open_pv
,push_open_2_uv
,push_open_2_pv
,op_receive_uv
,op_receive_pv
,op_push_open_uv
,op_push_open_pv
,op_push_open_2_uv
,op_push_open_2_pv
,xitong_receive_uv
,xitong_receive_pv
,xitong_push_open_uv
,xitong_push_open_pv
,xitong_push_open_2_uv
,xitong_push_open_2_pv
,will_receive_uv
,will_receive_pv
,will_push_open_uv
,will_push_open_pv
,will_push_open_2_uv
,will_push_open_2_pv
,sign_receive_uv
,sign_receive_pv
,sign_push_open_uv
,sign_push_open_pv
,sign_push_open_2_uv
,sign_push_open_2_pv
,personal_receive_uv
,personal_receive_pv
,personal_push_open_uv
,personal_push_open_pv
,personal_push_open_2_uv
,personal_push_open_2_pv
,ctr_receive_uv
,ctr_receive_pv
,ctr_push_open_uv
,ctr_push_open_pv
,ctr_push_open_2_uv
,ctr_push_open_2_uv
,non_ctr_receive_uv
,non_ctr_receive_pv
,non_ctr_push_open_uv
,non_ctr_push_open_pv
,non_ctr_push_open_2_uv
,non_ctr_push_open_2_uv
,AI_receive_uv
,AI_receive_pv
,AI_push_open_pv
,AI_push_open_uv
,AI_push_open_2_uv
,AI_push_open_2_uv
,auto_receive_uv
,auto_receive_pv
,auto_push_open_uv
,auto_push_open_pv
,auto_push_open_2_uv
,auto_push_open_2_pv
FROM
(
SELECT t1.partition_date
,device_os_type ,device_os_type
,active_type ,active_type
,count(distinct t1.device_id) as dau ,count(distinct t1.device_id) as dau
...@@ -23,10 +91,10 @@ SELECT t1.partition_date as day_id ...@@ -23,10 +91,10 @@ SELECT t1.partition_date as day_id
,sum(NVL(t2.op_push_open_pv,0)) as op_push_open_pv --运营push拉起人次 ,sum(NVL(t2.op_push_open_pv,0)) as op_push_open_pv --运营push拉起人次
,count(distinct case when op_push_open_2_pv is not null and op_push_open_2_pv>0 then t5.cl_id end) as op_push_open_2_uv --运营push拉起有2跳设备数 ,count(distinct case when op_push_open_2_pv is not null and op_push_open_2_pv>0 then t5.cl_id end) as op_push_open_2_uv --运营push拉起有2跳设备数
,sum(NVL(t5.op_push_open_2_pv,0)) as op_push_open_2_pv --运营push拉起有2跳人次 ,sum(NVL(t5.op_push_open_2_pv,0)) as op_push_open_2_pv --运营push拉起有2跳人次
,count(distinct case when auto_push_open_pv is not null and auto_push_open_pv>0 then t2.cl_id end) as auto_push_open_uv --自动push拉起设备数 ,count(distinct case when xitong_push_open_pv is not null and xitong_push_open_pv>0 then t2.cl_id end) as xitong_push_open_uv --自动push拉起设备数
,sum(NVL(t2.auto_push_open_pv,0)) as auto_push_open_pv --自动push拉起人次 ,sum(NVL(t2.xitong_push_open_pv,0)) as xitong_push_open_pv --自动push拉起人次
,count(distinct case when auto_push_open_2_pv is not null and auto_push_open_2_pv>0 then t5.cl_id end) as auto_push_open_2_uv --自动push拉起有2跳设备数 ,count(distinct case when xitong_push_open_2_pv is not null and xitong_push_open_2_pv>0 then t5.cl_id end) as xitong_push_open_2_uv --自动push拉起有2跳设备数
,sum(NVL(t5.auto_push_open_2_pv,0)) as auto_push_open_2_pv --自动push拉起有2跳人次 ,sum(NVL(t5.xitong_push_open_2_pv,0)) as xitong_push_open_2_pv --自动push拉起有2跳人次
,count(distinct case when will_push_open_pv is not null and will_push_open_pv>0 then t2.cl_id end) as will_push_open_uv --意愿探索push拉起设备数 ,count(distinct case when will_push_open_pv is not null and will_push_open_pv>0 then t2.cl_id end) as will_push_open_uv --意愿探索push拉起设备数
,sum(NVL(t2.will_push_open_pv,0)) as will_push_open_pv --意愿探索push拉起人次 ,sum(NVL(t2.will_push_open_pv,0)) as will_push_open_pv --意愿探索push拉起人次
,count(distinct case when will_push_open_2_pv is not null and will_push_open_2_pv>0 then t5.cl_id end) as will_push_open_2_uv --意愿探索push拉起有2跳设备数 ,count(distinct case when will_push_open_2_pv is not null and will_push_open_2_pv>0 then t5.cl_id end) as will_push_open_2_uv --意愿探索push拉起有2跳设备数
...@@ -35,10 +103,10 @@ SELECT t1.partition_date as day_id ...@@ -35,10 +103,10 @@ SELECT t1.partition_date as day_id
,sum(NVL(t2.sign_push_open_pv,0)) as sign_push_open_pv --签到push拉起人次 ,sum(NVL(t2.sign_push_open_pv,0)) as sign_push_open_pv --签到push拉起人次
,count(distinct case when sign_push_open_2_pv is not null and sign_push_open_2_pv>0 then t5.cl_id end) as sign_push_open_2_uv --签到push拉起有2跳设备数 ,count(distinct case when sign_push_open_2_pv is not null and sign_push_open_2_pv>0 then t5.cl_id end) as sign_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.sign_push_open_2_pv,0)) as sign_push_open_2_pv ,sum(NVL(t5.sign_push_open_2_pv,0)) as sign_push_open_2_pv
,count(distinct case when t2.ctr_push_open_pv+t2.non_ctr_push_open_pv+t2.will_push_open_pv>0 then t2.cl_id end) as personal_push_open_uv --个性化push拉起设备数 ,count(distinct case when t2.ctr_push_open_pv+t2.non_ctr_push_open_pv>0 then t2.cl_id end) as personal_push_open_uv --个性化push拉起设备数
,sum(NVL(t2.ctr_push_open_pv+t2.non_ctr_push_open_pv+t2.will_push_open_pv,0)) as personal_push_open_pv --个性化push拉起人次 ,sum(NVL(t2.ctr_push_open_pv+t2.non_ctr_push_open_pv,0)) as personal_push_open_pv --个性化push拉起人次
,count(distinct case when t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv+t5.will_push_open_2_pv>0 then t5.cl_id end) as personal_push_open_2_uv --个性化push拉起设备数 ,count(distinct case when t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv>0 then t5.cl_id end) as personal_push_open_2_uv --个性化push拉起设备数
,sum(NVL(t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv+t5.will_push_open_2_pv,0)) as personal_push_open_2_pv --个性化push拉起有2跳人次 ,sum(NVL(t5.ctr_push_open_2_pv+t5.non_ctr_push_open_2_pv,0)) as personal_push_open_2_pv --个性化push拉起有2跳人次
,count(distinct case when ctr_push_open_pv is not null and ctr_push_open_pv>0 then t2.cl_id end) as ctr_push_open_uv --签到push拉起设备数 ,count(distinct case when ctr_push_open_pv is not null and ctr_push_open_pv>0 then t2.cl_id end) as ctr_push_open_uv --签到push拉起设备数
,sum(NVL(t2.ctr_push_open_pv,0)) as ctr_push_open_pv --签到push拉起人次 ,sum(NVL(t2.ctr_push_open_pv,0)) as ctr_push_open_pv --签到push拉起人次
,count(distinct case when ctr_push_open_2_pv is not null and ctr_push_open_2_pv>0 then t5.cl_id end) as ctr_push_open_2_uv --签到push拉起有2跳设备数 ,count(distinct case when ctr_push_open_2_pv is not null and ctr_push_open_2_pv>0 then t5.cl_id end) as ctr_push_open_2_uv --签到push拉起有2跳设备数
...@@ -51,19 +119,19 @@ SELECT t1.partition_date as day_id ...@@ -51,19 +119,19 @@ SELECT t1.partition_date as day_id
,sum(NVL(t2.AI_push_open_pv,0)) as AI_push_open_pv --签到push拉起人次 ,sum(NVL(t2.AI_push_open_pv,0)) as AI_push_open_pv --签到push拉起人次
,count(distinct case when AI_push_open_2_pv is not null and AI_push_open_2_pv>0 then t5.cl_id end) as AI_push_open_2_uv --签到push拉起有2跳设备数 ,count(distinct case when AI_push_open_2_pv is not null and AI_push_open_2_pv>0 then t5.cl_id end) as AI_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.AI_push_open_2_pv,0)) as AI_push_open_2_pv ,sum(NVL(t5.AI_push_open_2_pv,0)) as AI_push_open_2_pv
,count(distinct case when orignal_auto_push_open_pv is not null and orignal_auto_push_open_pv>0 then t2.cl_id end) as orignal_auto_push_open_uv --签到push拉起设备数 ,count(distinct case when auto_push_open_pv is not null and auto_push_open_pv>0 then t2.cl_id end) as auto_push_open_uv --签到push拉起设备数
,sum(NVL(t2.orignal_auto_push_open_pv,0)) as orignal_auto_push_open_pv --签到push拉起人次 ,sum(NVL(t2.auto_push_open_pv,0)) as auto_push_open_pv --签到push拉起人次
,count(distinct case when orginal_auto_push_open_2_pv is not null and orginal_auto_push_open_2_pv>0 then t5.cl_id end) as orginal_auto_push_open_2_uv --签到push拉起有2跳设备数 ,count(distinct case when auto_push_open_2_pv is not null and auto_push_open_2_pv>0 then t5.cl_id end) as auto_push_open_2_uv --签到push拉起有2跳设备数
,sum(NVL(t5.orginal_auto_push_open_2_pv,0)) as orginal_auto_push_open_2_pv ,sum(NVL(t5.auto_push_open_2_pv,0)) as auto_push_open_2_pv
FROM FROM
( (
select select
partition_date partition_date
,device_id ,device_id
,device_os_type ,device_os_type
,case WHEN active_type = '4' THEN '老活' WHEN active_type in ('1','2') then '新增' END as active_type ,case WHEN active_type = '4' THEN '老活' WHEN active_type in ('1','2') then '新增' END as active_type
from online.ml_device_day_active_status from online.ml_device_day_active_status
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND active_type in ('4','1','2') AND active_type in ('4','1','2')
AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3' AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang' ,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
...@@ -73,15 +141,15 @@ FROM ...@@ -73,15 +141,15 @@ FROM
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ' ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei','','unknown') ,'promotion_shike','promotion_julang_jl03','promotion_zuimei','','unknown')
AND first_channel_source_type not LIKE 'promotion\_jf\_%' AND first_channel_source_type not LIKE 'promotion\_jf\_%'
)t1 )t1
LEFT JOIN LEFT JOIN
( (
select a.partition_date,a.cl_id --开启push设备 select a.partition_date,a.cl_id --开启push设备
from from
( (
SELECT partition_date,cl_id,max(time_str) as max_time_str SELECT partition_date,cl_id,max(time_str) as max_time_str
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='is_open_push' and action='is_open_push'
group by partition_date,cl_id group by partition_date,cl_id
)a )a
...@@ -90,27 +158,29 @@ LEFT JOIN ...@@ -90,27 +158,29 @@ LEFT JOIN
SELECT partition_date, SELECT partition_date,
cl_id,time_str,COALESCE(params['type'],params['tyep']) as type cl_id,time_str,COALESCE(params['type'],params['tyep']) as type
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='is_open_push' and action='is_open_push'
)b )b
on b.partition_date=a.partition_date and b.cl_id=a.cl_id and b.time_str=a.max_time_str on b.partition_date=a.partition_date and b.cl_id=a.cl_id and b.time_str=a.max_time_str
where type=1 where type=1
group by a.partition_date,a.cl_id group by a.partition_date,a.cl_id
)is_open )is_open
on is_open.partition_date=t1.partition_date and is_open.cl_id=t1.device_id on is_open.partition_date=t1.partition_date and is_open.cl_id=t1.device_id
LEFT JOIN LEFT JOIN
( (
SELECT a.partition_date,a.cl_id, SELECT a.partition_date,a.cl_id,
count(distinct a.message_id) as push_open_pv, count(distinct a.message_id) as push_open_pv,
count(distinct case when push_type in ('70','71') then a.message_id end) as op_push_open_pv, --运营push push_type in ('70','71') count(distinct case when push_type in ('70','71') then a.message_id end) as op_push_open_pv, --运营push push_type in ('70','71')
count(distinct case when push_type in ('101','102','103','104','105') then a.message_id end) as ctr_push_open_pv, --个性化push count(distinct case when push_type in ('101','102','103') then a.message_id end) as ctr_push_open_pv, --个性化push
count(distinct case when push_type in ('111','112','113') then a.message_id end) as non_ctr_push_open_pv, --个性化push count(distinct case when push_type in ('111','112','113') then a.message_id end) as non_ctr_push_open_pv, --个性化push
count(distinct case when push_type in ('104') then a.message_id end) as qa_push_open_pv, --邀请回答push
count(distinct case when push_type in ('105') then a.message_id end) as location_push_open_pv, --地狱push
count(distinct case when push_type in ('106','107','108') then a.message_id end) as will_push_open_pv, --意愿push count(distinct case when push_type in ('106','107','108') then a.message_id end) as will_push_open_pv, --意愿push
count(distinct case when push_type in ('25') then a.message_id end) as sign_push_open_pv, --签到push count(distinct case when push_type in ('25') then a.message_id end) as sign_push_open_pv, --签到push
count(distinct case when push_type is not null count(distinct case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.message_id end) as auto_push_open_pv, --自动push and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.message_id end) as xitong_push_open_pv, --系统push
count(distinct case when push_type in ('93','94') then a.message_id end) as AI_push_open_pv, count(distinct case when push_type in ('93','94') then a.message_id end) as AI_push_open_pv,
count(distinct case when push_type is not null and push_type not in ('70','71') then a.message_id end) as orignal_auto_push_open_pv --自动push count(distinct case when push_type is not null and push_type not in ('70','71') then a.message_id end) as auto_push_open_pv --自动push
FROM FROM
( (
SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id
...@@ -119,7 +189,7 @@ LEFT JOIN ...@@ -119,7 +189,7 @@ LEFT JOIN
--设备开启 --设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='device_opened' and action='device_opened'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id
)a )a
...@@ -128,7 +198,7 @@ LEFT JOIN ...@@ -128,7 +198,7 @@ LEFT JOIN
--推送点击 --推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='notification_open' and action='notification_open'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id'] group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b )b
...@@ -143,7 +213,7 @@ LEFT JOIN ...@@ -143,7 +213,7 @@ LEFT JOIN
( (
select msg_id,push_type,time_stamp select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表 from online.tl_hdfs_push2_new_view --增量表
where partition_date>='20190801' AND partition_date<= regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date>='20190801' AND partition_date<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp group by msg_id,push_type,time_stamp
)a )a
left join left join
...@@ -152,7 +222,7 @@ LEFT JOIN ...@@ -152,7 +222,7 @@ LEFT JOIN
FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表 FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629' AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629'
AND regexp_replace(substr(pushtime,1,10),'-','') <= regexp_replace(DATE_SUB(current_date,1) ,'-','') AND regexp_replace(substr(pushtime,1,10),'-','') <= '20200714'
AND approver_status = 'true' --审核状态,true表示审核通过 AND approver_status = 'true' --审核状态,true表示审核通过
AND status = '2' --推送状态,2表示发送成功,1表示准备发送 AND status = '2' --推送状态,2表示发送成功,1表示准备发送
AND creator_id in ('32018153','32719681','32264790','31779749','31436904') AND creator_id in ('32018153','32719681','32264790','31779749','31436904')
...@@ -161,24 +231,26 @@ LEFT JOIN ...@@ -161,24 +231,26 @@ LEFT JOIN
)e )e
on e.msg_id=a.message_id on e.msg_id=a.message_id
group by a.partition_date,a.cl_id group by a.partition_date,a.cl_id
)t2 )t2
on t2.cl_id=t1.device_id and t2.partition_date=t1.partition_date on t2.cl_id=t1.device_id and t2.partition_date=t1.partition_date
LEFT JOIN LEFT JOIN
( (
--push拉起后有2跳的设备 --push拉起后有2跳的设备
SELECT partition_date, SELECT partition_date,
a.cl_id, a.cl_id,
count(distinct a.app_session_id) as push_open_2_pv, count(distinct a.app_session_id) as push_open_2_pv,
count(distinct case when push_type in ('70','71') then a.app_session_id end) as op_push_open_2_pv, --运营push push_type in ('70','71') count(distinct case when push_type in ('70','71') then a.app_session_id end) as op_push_open_2_pv, --运营push push_type in ('70','71')
count(distinct case when push_type in ('101','102','103','104','105') then a.app_session_id end) as ctr_push_open_2_pv, --个性化push count(distinct case when push_type in ('101','102','103') then a.app_session_id end) as ctr_push_open_2_pv, --个性化push
count(distinct case when push_type in ('111','112','113') then a.app_session_id end) as non_ctr_push_open_2_pv, --个性化push count(distinct case when push_type in ('111','112','113') then a.app_session_id end) as non_ctr_push_open_2_pv, --个性化push
count(distinct case when push_type in ('104') then a.app_session_id end) as qa_push_open_2_pv, --个性化push
count(distinct case when push_type in ('105') then a.app_session_id end) as location_push_open_2_pv, --个性化push
count(distinct case when push_type in ('106','107','108') then a.app_session_id end) as will_push_open_2_pv, --意愿push count(distinct case when push_type in ('106','107','108') then a.app_session_id end) as will_push_open_2_pv, --意愿push
count(distinct case when push_type in ('25') then a.app_session_id end) as sign_push_open_2_pv, --签到push count(distinct case when push_type in ('25') then a.app_session_id end) as sign_push_open_2_pv, --签到push
count(distinct case when push_type is not null count(distinct case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.app_session_id end) as auto_push_open_2_pv, --自动push and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.app_session_id end) as xitong_push_open_2_pv, --系统push
count(distinct case when push_type in ('93','94') then a.app_session_id end) as AI_push_open_2_pv, --签到push count(distinct case when push_type in ('93','94') then a.app_session_id end) as AI_push_open_2_pv, --签到push
count(distinct case when push_type is not null and push_type not in ('70','71') then a.app_session_id end) as orginal_auto_push_open_2_pv --自动push count(distinct case when push_type is not null and push_type not in ('70','71') then a.app_session_id end) as auto_push_open_2_pv --自动push
FROM FROM
( (
SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id SELECT a.partition_date,b.cl_id,a.app_session_id,b.message_id
...@@ -187,7 +259,7 @@ LEFT JOIN ...@@ -187,7 +259,7 @@ LEFT JOIN
--设备开启 --设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='device_opened' and action='device_opened'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id
)a )a
...@@ -196,7 +268,7 @@ LEFT JOIN ...@@ -196,7 +268,7 @@ LEFT JOIN
--推送点击 --推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='notification_open' and action='notification_open'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id'] group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b )b
...@@ -220,7 +292,7 @@ LEFT JOIN ...@@ -220,7 +292,7 @@ LEFT JOIN
FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表 FROM online.tl_hdfs_api_pushtask2_view --mars后台消息推送表
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629' AND regexp_replace(substr(pushtime,1,10),'-','') >= '20200629'
AND regexp_replace(substr(pushtime,1,10),'-','') <= regexp_replace(DATE_SUB(current_date,1) ,'-','') AND regexp_replace(substr(pushtime,1,10),'-','') <= '20200714'
AND approver_status = 'true' --审核状态,true表示审核通过 AND approver_status = 'true' --审核状态,true表示审核通过
AND status = '2' --推送状态,2表示发送成功,1表示准备发送 AND status = '2' --推送状态,2表示发送成功,1表示准备发送
AND creator_id in ('32018153','32719681','32264790','31779749','31436904') AND creator_id in ('32018153','32719681','32264790','31779749','31436904')
...@@ -236,7 +308,7 @@ LEFT JOIN ...@@ -236,7 +308,7 @@ LEFT JOIN
( (
SELECT partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home') as is_home SELECT partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home') as is_home
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='page_view' and action='page_view'
GROUP BY partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home') GROUP BY partition_date,cl_id,app_session_id,cl_type,if(page_name='home','home','non_home')
)a )a
...@@ -246,7 +318,7 @@ LEFT JOIN ...@@ -246,7 +318,7 @@ LEFT JOIN
,count(distinct page_name) as page_num ,count(distinct page_name) as page_num
,count(distinct array(time_str,page_name)) as page_array ,count(distinct array(time_str,page_name)) as page_array
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='page_view' and action='page_view'
GROUP BY partition_date,cl_id,app_session_id,cl_type GROUP BY partition_date,cl_id,app_session_id,cl_type
)b )b
...@@ -268,11 +340,116 @@ LEFT JOIN ...@@ -268,11 +340,116 @@ LEFT JOIN
AND a.cl_id = c.cl_id AND a.cl_id = c.cl_id
AND a.app_session_id = c.app_session_id AND a.app_session_id = c.app_session_id
GROUP BY a.cl_id,a.partition_date GROUP BY a.cl_id,a.partition_date
)t5 )t5
on t1.partition_date=t5.partition_date and t1.device_id=t5.cl_id on t1.partition_date=t5.partition_date and t1.device_id=t5.cl_id
GROUP BY t1.partition_date,device_os_type,active_type GROUP BY t1.partition_date,device_os_type,active_type
)click
full join
(
SELECT a.partition_date
,device_os_type
,'老活' as active_type
,count(distinct a.device_id) as push_receive_uv
,count(distinct case when push_type in ('70','71') then a.device_id end) as op_receive_uv --运营push push_type in ('70','71')
,count(distinct case when push_type in ('101','102','103','111','112','113') then a.device_id end) as personal_receive_uv --个性化push
,count(distinct case when push_type in ('101','102','103') then a.device_id end) as ctr_receive_uv --个性化push
,count(distinct case when push_type in ('111','112','113') then a.device_id end) as non_ctr_receive_uv --个性化push
,count(distinct case when push_type in ('104') then a.device_id end) as qa_receive_uv --邀请回答push
,count(distinct case when push_type in ('105') then a.device_id end) as location_receive_uv --地狱push
,count(distinct case when push_type in ('106','107','108') then a.device_id end) as will_receive_uv --意愿push
,count(distinct case when push_type in ('25') then a.device_id end) as sign_receive_uv --签到push
,count(distinct case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.device_id end) as xitong_receive_uv --系统push
,count(distinct case when push_type in ('93','94') then a.device_id end) as AI_receive_uv
,count(distinct case when push_type is not null and push_type not in ('70','71') then a.device_id end) as auto_receive_uv --自动push
,count(a.device_id) as push_receive_pv
,count(case when push_type in ('70','71') then a.device_id end) as op_receive_pv --运营push push_type in ('70','71')
,count(case when push_type in ('101','102','103','111','112','113') then a.device_id end) as personal_receive_pv --个性化push
,count(case when push_type in ('101','102','103') then a.device_id end) as ctr_receive_pv --个性化push
,count(case when push_type in ('111','112','113') then a.device_id end) as non_ctr_receive_pv --个性化push
,count(case when push_type in ('104') then a.device_id end) as qa_receive_pv --邀请回答push
,count(case when push_type in ('105') then a.device_id end) as location_receive_pv --地狱push
,count(case when push_type in ('106','107','108') then a.device_id end) as will_receive_pv --意愿push
,count(case when push_type in ('25') then a.device_id end) as sign_receive_pv --签到push
,count(case when push_type is not null
and push_type not in ('70','71','101','102','103','104','105','111','112','113','106','107','108','25') then a.device_id end) as xitong_receive_pv --系统push
,count(case when push_type in ('93','94') then a.device_id end) as AI_receive_pv
,count(case when push_type is not null and push_type not in ('70','71') then a.device_id end) as auto_receive_pv --自动push
FROM
(
select partition_day as partition_date
,device_id,msg_id,'ios' as device_os_type
from bl.bl_et_bg_trackingpushlog_inc_d
where partition_day>='20200521' and partition_day <= regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by partition_day,device_id,msg_id
union all
SELECT partition_date,device_id,mesid as msg_id,'android' as device_os_type
FROM
(
SELECT partition_date,registration_id,platform,mesid
FROM online.tl_hdfs_auroracallback_view--推送push的回调表
where partition_date>='20200521' AND partition_date<= regexp_replace(DATE_SUB(current_date,1) ,'-','')
--and notification_state='true'--用户开启通知
and callback_type = '0'--送达回执
and platform='android'
group by partition_date,registration_id,platform,mesid
)msg
JOIN
(
SELECT device_id,registration_id
from online.tl_hdfs_api_jpushuserdevicebinding_view--极光id和设备id绑定关系全量表
where partition_date=regexp_replace(date_sub(current_date(),1),'-','')
and (registration_id is not null or registration_id <>'')
group by device_id,registration_id
)reg
on reg.registration_id=msg.registration_id
)a
JOIN
(
select device_id
from online.ml_device_history_detail
where partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and first_channel_source_type not in ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei')
AND first_channel_source_type not like 'promotion\_jf\_%'
)b
on a.device_id=b.device_id
JOIN
(
select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表
where partition_date>='20190801' AND partition_date<= regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp
)c
on a.msg_id=c.msg_id
left join
(
select
partition_date
,device_id
from online.ml_device_day_active_status
where partition_date = regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND active_type in ('1','2','3')
)d
on a.partition_date=d.partition_date and a.device_id=d.device_id
where d.device_id is null
group by a.partition_date
,device_os_type
)received
on click.partition_date = received.partition_date
and click.device_os_type=received.device_os_type
and click.active_type=received.active_type
order by day_id,device_os_type,active_type; order by day_id,device_os_type,active_type;
--push接收数据 --push接收数据
......
#step1_8.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_auroracallback_view
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_api_jpushuserdevicebinding_view
\ No newline at end of file
#step2.job #step2.job
type=command type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7 dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7,step1_8,step1_9
command=/home/bi/bi-report/lib/shell/hive daily_push command=/home/bi/bi-report/lib/shell/hive daily_push
\ No newline at end of file
#step4.job #step3.job
type=command type=command
dependencies=step3_1,step3_2
command=curl -X GET http://localhost:8553/api/report/email/daily_push/liweirui@igengmei.com,duanyingrong@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,weiyimin@igengmei.com command=curl -X GET http://localhost:8553/api/report/email/daily_push/liweirui@igengmei.com,duanyingrong@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,weiyimin@igengmei.com
\ No newline at end of file
#step3_1.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_push_click_d
\ No newline at end of file
#step3_2.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_push_receive_d
\ No newline at end of file
...@@ -25,7 +25,8 @@ select day_id as `日期` ...@@ -25,7 +25,8 @@ select day_id as `日期`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳设备/push开启设备数` ,NVL(CONCAT(ROUND(non_ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳人次/push开启设备数` ,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/non_ctr_push_open_pv*100,2),'%'),0) as `非ctr push二跳率=2跳人次/拉起人次` ,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/non_ctr_push_open_pv*100,2),'%'),0) as `非ctr push二跳率=2跳人次/拉起人次`
from pm.tl_pm_push_click_d from pm.tl_pm_push_d
where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','') where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>='20200626' and day_id>='20200626'
and active_type='老活'
order by `日期`,`设备类型`,`活跃类型` order by `日期`,`设备类型`,`活跃类型`
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