Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bi-report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data
bi-report
Commits
3ab81ee6
Commit
3ab81ee6
authored
Jul 21, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push codes
parent
204fd407
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
13 deletions
+44
-13
create_push.sql
pm/daily_push/etl/create_push.sql
+13
-1
daily_push.sql
pm/daily_push/etl/daily_push.sql
+30
-11
daily_push_click.sql
pm/daily_push/report/daily_push_click.sql
+1
-1
No files found.
pm/daily_push/etl/create_push.sql
View file @
3ab81ee6
...
@@ -80,7 +80,19 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d
...
@@ -80,7 +80,19 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d
auto_push_open_uv
BIGINT
comment
'{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
auto_push_open_uv
BIGINT
comment
'{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
auto_push_open_pv
BIGINT
comment
'{"chs_name":"除运营外push拉起人次","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_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":""}'
auto_push_open_2_pv
BIGINT
comment
'{"chs_name":"除运营外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}'
,
location_receive_uv
BIGINT
comment
'{"chs_name":"地狱push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
location_receive_pv
BIGINT
comment
'{"chs_name":"地狱push拉起人次","description":"","etl":"","value":"","remark":""}'
,
location_push_open_uv
BIGINT
comment
'{"chs_name":"地狱push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
location_push_open_pv
BIGINT
comment
'{"chs_name":"地狱push拉起人次","description":"","etl":"","value":"","remark":""}'
,
location_push_open_2_uv
BIGINT
comment
'{"chs_name":"地狱push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}'
,
location_push_open_2_pv
BIGINT
comment
'{"chs_name":"地狱push拉起有2跳人次","description":"","etl":"","value":"","remark":""}'
,
qa_receive_uv
BIGINT
comment
'{"chs_name":"邀请问答push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
qa_receive_pv
BIGINT
comment
'{"chs_name":"邀请问答push拉起人次","description":"","etl":"","value":"","remark":""}'
,
qa_push_open_uv
BIGINT
comment
'{"chs_name":"邀请问答push拉起设备数","description":"","etl":"","value":"","remark":""}'
,
qa_push_open_pv
BIGINT
comment
'{"chs_name":"邀请问答push拉起人次","description":"","etl":"","value":"","remark":""}'
,
qa_push_open_2_uv
BIGINT
comment
'{"chs_name":"邀请问答push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}'
,
qa_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
...
...
pm/daily_push/etl/daily_push.sql
View file @
3ab81ee6
...
@@ -8,8 +8,7 @@ SET mapred.reduce.tasks=20;
...
@@ -8,8 +8,7 @@ SET mapred.reduce.tasks=20;
SET
role
admin
;
SET
role
admin
;
--push点击数据
--push点击数据
INSERT
OVERWRITE
TABLE
pm
.
tl_pm_push_d
PARTITION
(
PARTITION_DAY
=
${
partition_day
}
)
INSERT
OVERWRITE
TABLE
pm
.
tl_pm_push_detail_d
PARTITION
(
PARTITION_DAY
=
${
partition_day
}
)
SELECT
NVL
(
click
.
partition_date
,
received
.
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
.
device_os_type
,
received
.
device_os_type
)
as
device_os_type
...
@@ -57,25 +56,37 @@ SELECT NVL(click.partition_date,received.partition_date) as day_id
...
@@ -57,25 +56,37 @@ SELECT NVL(click.partition_date,received.partition_date) as day_id
,
ctr_push_open_uv
,
ctr_push_open_uv
,
ctr_push_open_pv
,
ctr_push_open_pv
,
ctr_push_open_2_uv
,
ctr_push_open_2_uv
,
ctr_push_open_2_
u
v
,
ctr_push_open_2_
p
v
,
non_ctr_receive_uv
,
non_ctr_receive_uv
,
non_ctr_receive_pv
,
non_ctr_receive_pv
,
non_ctr_push_open_uv
,
non_ctr_push_open_uv
,
non_ctr_push_open_pv
,
non_ctr_push_open_pv
,
non_ctr_push_open_2_uv
,
non_ctr_push_open_2_uv
,
non_ctr_push_open_2_
u
v
,
non_ctr_push_open_2_
p
v
,
AI_receive_uv
,
AI_receive_uv
,
AI_receive_pv
,
AI_receive_pv
,
AI_push_open_pv
,
AI_push_open_pv
,
AI_push_open_uv
,
AI_push_open_uv
,
AI_push_open_2_uv
,
AI_push_open_2_uv
,
AI_push_open_2_
u
v
,
AI_push_open_2_
p
v
,
auto_receive_uv
,
auto_receive_uv
,
auto_receive_pv
,
auto_receive_pv
,
auto_push_open_uv
,
auto_push_open_uv
,
auto_push_open_pv
,
auto_push_open_pv
,
auto_push_open_2_uv
,
auto_push_open_2_uv
,
auto_push_open_2_pv
,
auto_push_open_2_pv
,
location_receive_uv
,
location_receive_pv
,
location_push_open_uv
,
location_push_open_pv
,
location_push_open_2_uv
,
location_push_open_2_pv
,
qa_receive_uv
,
qa_receive_pv
,
qa_push_open_uv
,
qa_push_open_pv
,
qa_push_open_2_uv
,
qa_push_open_2_pv
FROM
FROM
(
(
SELECT
t1
.
partition_date
SELECT
t1
.
partition_date
...
@@ -123,6 +134,14 @@ FROM
...
@@ -123,6 +134,14 @@ FROM
,
sum
(
NVL
(
t2
.
auto_push_open_pv
,
0
))
as
auto_push_open_pv
--签到push拉起人次
,
sum
(
NVL
(
t2
.
auto_push_open_pv
,
0
))
as
auto_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
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
.
auto_push_open_2_pv
,
0
))
as
auto_push_open_2_pv
,
sum
(
NVL
(
t5
.
auto_push_open_2_pv
,
0
))
as
auto_push_open_2_pv
,
count
(
distinct
case
when
location_push_open_pv
is
not
null
and
location_push_open_pv
>
0
then
t2
.
cl_id
end
)
as
location_push_open_uv
--地狱push拉起设备数
,
sum
(
NVL
(
t2
.
location_push_open_pv
,
0
))
as
location_push_open_pv
--地狱push拉起人次
,
count
(
distinct
case
when
location_push_open_2_pv
is
not
null
and
location_push_open_2_pv
>
0
then
t5
.
cl_id
end
)
as
location_push_open_2_uv
--地狱push拉起有2跳设备数
,
sum
(
NVL
(
t5
.
location_push_open_2_pv
,
0
))
as
location_push_open_2_pv
,
count
(
distinct
case
when
qa_push_open_pv
is
not
null
and
qa_push_open_pv
>
0
then
t2
.
cl_id
end
)
as
qa_push_open_uv
--邀请回答push拉起设备数
,
sum
(
NVL
(
t2
.
qa_push_open_pv
,
0
))
as
qa_push_open_pv
--邀请回答push拉起人次
,
count
(
distinct
case
when
qa_push_open_2_pv
is
not
null
and
qa_push_open_2_pv
>
0
then
t5
.
cl_id
end
)
as
qa_push_open_2_uv
--邀请回答push拉起有2跳设备数
,
sum
(
NVL
(
t5
.
qa_push_open_2_pv
,
0
))
as
qa_push_open_2_pv
FROM
FROM
(
(
select
select
...
@@ -178,7 +197,7 @@ FROM
...
@@ -178,7 +197,7 @@ FROM
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
xitong_push_open_pv
,
--系统push
and
push_type
not
in
(
'70'
,
'71'
,
'101'
,
'102'
,
'103'
,
'104'
,
'105'
,
'111'
,
'112'
,
'113'
,
'106'
,
'107'
,
'108'
,
'25'
,
'93'
,
'94'
)
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
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
...
@@ -248,7 +267,7 @@ FROM
...
@@ -248,7 +267,7 @@ FROM
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
xitong_push_open_2_pv
,
--系统push
and
push_type
not
in
(
'70'
,
'71'
,
'101'
,
'102'
,
'103'
,
'104'
,
'105'
,
'111'
,
'112'
,
'113'
,
'106'
,
'107'
,
'108'
,
'25'
,
'93'
,
'94'
)
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
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
...
@@ -359,7 +378,7 @@ full join
...
@@ -359,7 +378,7 @@ full join
,
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
(
'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
in
(
'25'
)
then
a
.
device_id
end
)
as
sign_receive_uv
--签到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
.
device_id
end
)
as
xitong_receive_uv
--系统push
and
push_type
not
in
(
'70'
,
'71'
,
'101'
,
'102'
,
'103'
,
'104'
,
'105'
,
'111'
,
'112'
,
'113'
,
'106'
,
'107'
,
'108'
,
'25'
,
'93'
,
'94'
)
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
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
(
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
(
a
.
device_id
)
as
push_receive_pv
...
@@ -372,7 +391,7 @@ full join
...
@@ -372,7 +391,7 @@ full join
,
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
(
'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
in
(
'25'
)
then
a
.
device_id
end
)
as
sign_receive_pv
--签到push
,
count
(
case
when
push_type
is
not
null
,
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
and
push_type
not
in
(
'70'
,
'71'
,
'101'
,
'102'
,
'103'
,
'104'
,
'105'
,
'111'
,
'112'
,
'113'
,
'106'
,
'107'
,
'108'
,
'25'
,
'93'
,
'94'
)
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
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
,
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
...
@@ -381,7 +400,7 @@ full join
...
@@ -381,7 +400,7 @@ full join
select
partition_day
as
partition_date
select
partition_day
as
partition_date
,
device_id
,
msg_id
,
'ios'
as
device_os_type
,
device_id
,
msg_id
,
'ios'
as
device_os_type
from
bl
.
bl_et_bg_trackingpushlog_inc_d
from
bl
.
bl_et_bg_trackingpushlog_inc_d
where
partition_day
>=
'20200521'
and
partition_day
<
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
where
partition_day
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
group
by
partition_day
,
device_id
,
msg_id
group
by
partition_day
,
device_id
,
msg_id
union
all
union
all
...
@@ -391,7 +410,7 @@ full join
...
@@ -391,7 +410,7 @@ full join
(
(
SELECT
partition_date
,
registration_id
,
platform
,
mesid
SELECT
partition_date
,
registration_id
,
platform
,
mesid
FROM
online
.
tl_hdfs_auroracallback_view
--推送push的回调表
FROM
online
.
tl_hdfs_auroracallback_view
--推送push的回调表
where
partition_date
>=
'20200521'
AND
partition_date
<
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
where
partition_date
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
--and notification_state='true'--用户开启通知
--and notification_state='true'--用户开启通知
and
callback_type
=
'0'
--送达回执
and
callback_type
=
'0'
--送达回执
and
platform
=
'android'
and
platform
=
'android'
...
...
pm/daily_push/report/daily_push_click.sql
View file @
3ab81ee6
...
@@ -25,7 +25,7 @@ select day_id as `日期`
...
@@ -25,7 +25,7 @@ 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_d
from
pm
.
tl_pm_push_d
etail_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
=
'老活'
and
active_type
=
'老活'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment