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
75041895
Commit
75041895
authored
Jul 17, 2020
by
yindanlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add doubtful_channel report codes
parent
a8d559be
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
134 additions
and
0 deletions
+134
-0
en-cn.properties
pm/doubtful_channel/en-cn.properties
+2
-0
create_doubtful_channel.sql
pm/doubtful_channel/etl/create_doubtful_channel.sql
+33
-0
doubtful_channel.sql
pm/doubtful_channel/etl/doubtful_channel.sql
+77
-0
step1_1.job
pm/doubtful_channel/job/step1_1.job
+4
-0
step1_2.job
pm/doubtful_channel/job/step1_2.job
+4
-0
step1_3.job
pm/doubtful_channel/job/step1_3.job
+4
-0
step2.job
pm/doubtful_channel/job/step2.job
+5
-0
step3.job
pm/doubtful_channel/job/step3.job
+5
-0
readme.txt
pm/doubtful_channel/readme.txt
+0
-0
No files found.
pm/doubtful_channel/en-cn.properties
0 → 100644
View file @
75041895
doutful_channel
=
可疑渠道
\ No newline at end of file
pm/doubtful_channel/etl/create_doubtful_channel.sql
0 → 100644
View file @
75041895
--***************************************************************
--*脚本名称:
--*功能: 可疑渠道(有日活和隐私弹窗浏览,但是无其他任何浏览或点击行为)
--*业务名称: pm
--*输入数据:
--*作者: yindanlei@igengmei.com
--*更新时间:2020-07-17
--***************************************************************
--设置全局变量&UDF
SET
mapreduce
.
job
.
queuename
=
data
;
--使用bl数据库
USE
pm
;
--创建BL层内部表
CREATE
TABLE
IF
NOT
EXISTS
pm
.
tl_pm_channel_d
(
day_id
string
comment
'{"chs_name":"日期","description":"","etl":"","value":"","remark":""}'
,
device_id
string
comment
'{"chs_name":"设备ID","description":"","etl":"","value":"","remark":""}'
,
device_os_type
string
comment
'{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}'
,
active_type
string
comment
'{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}'
,
first_channel_source_type
string
comment
'{"chs_name":"首次激活渠道","description":"","etl":"","value":"","remark":""}'
,
first_city
string
comment
'{"chs_name":"首次定位城市","description":"","etl":"","value":"","remark":""}'
)
comment
'可疑渠道'
PARTITIONED
BY
(
PARTITION_DAY
STRING
comment
'分区日期'
)
ROW
FORMAT
DELIMITED
FIELDS
TERMINATED
BY
'
\t
'
COLLECTION
ITEMS
TERMINATED
BY
'
\0
02'
MAP
KEYS
TERMINATED
BY
'
\0
03'
LINES
TERMINATED
BY
'
\n
'
STORED
AS
TEXTFILE
;
\ No newline at end of file
pm/doubtful_channel/etl/doubtful_channel.sql
0 → 100644
View file @
75041895
SET
mapreduce
.
job
.
queuename
=
data
;
SET
mapreduce
.
map
.
memory
.
mb
=
8192
;
SET
mapreduce
.
map
.
java
.
opts
=-
Xmx8000m
;
SET
mapreduce
.
reduce
.
memory
.
mb
=
8192
;
SET
mapreduce
.
reduce
.
java
.
opts
=-
Xmx8000m
;
set
hive
.
auto
.
convert
.
join
=
true
;
SET
mapred
.
reduce
.
tasks
=
20
;
SET
role
admin
;
INSERT
OVERWRITE
TABLE
pm
.
tl_pm_channel_d
PARTITION
(
PARTITION_DAY
=
${
partition_day
}
)
SELECT
a
.
partition_date
as
day_id
,
a
.
device_id
as
device_id
,
device_os_type
,
active_type
,
first_channel_source_type
,
first_city
FROM
(
SELECT
partition_date
,
device_os_type
,
device_id
,
first_channel_source_type
,
first_city
,
case
WHEN
active_type
=
'4'
THEN
'老活'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增'
END
as
active_type
FROM
ml_device_day_active_status
where
partition_date
>=
'20200101'
AND
partition_date
<
regexp_replace
(
current_date
,
'-'
,
''
)
AND
active_type
in
(
'1'
,
'2'
,
'4'
)
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'
,
''
,
'unknown'
)
AND
first_channel_source_type
not
like
'promotion
\_
jf
\_
%'
)
a
LEFT
JOIN
(
SELECT
partition_date
,
cl_id
from
bl_hdfs_maidian_updates
where
partition_date
>=
'20200101'
AND
partition_date
<
regexp_replace
(
current_date
,
'-'
,
''
)
AND
action
=
'popup_view'
AND
params
[
'popup_name'
]
=
'service_privacy'
GROUP
BY
partition_date
,
cl_id
)
b
ON
a
.
device_id
=
b
.
cl_id
AND
a
.
partition_date
=
b
.
partition_date
LEFT
JOIN
(
SELECT
partition_date
,
cl_id
from
bl_hdfs_maidian_updates
where
partition_date
>=
'20200101'
AND
partition_date
<
regexp_replace
(
current_date
,
'-'
,
''
)
AND
action
=
'page_view'
GROUP
BY
partition_date
,
cl_id
)
c
ON
a
.
device_id
=
c
.
cl_id
AND
a
.
partition_date
=
c
.
partition_date
LEFT
JOIN
(
SELECT
partition_day
,
device_id
FROM
ml
.
ml_c_et_ck_click_dimen_d
where
partition_date
>=
'20200101'
AND
partition_date
<
regexp_replace
(
current_date
,
'-'
,
''
)
GROUP
BY
partition_day
,
device_id
)
d
on
a
.
device_id
=
d
.
device_id
AND
a
.
partition_date
=
d
.
partition_day
WHERE
b
.
cl_id
is
NOT
NULL
AND
c
.
cl_id
is
NULL
AND
d
.
device_id
is
NULL
GROUP
BY
a
.
partition_date
,
a
.
device_id
,
device_os_type
,
active_type
,
first_channel_source_type
,
first_city
pm/doubtful_channel/job/step1_1.job
0 → 100644
View file @
75041895
#step1_1.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status
\ No newline at end of file
pm/doubtful_channel/job/step1_2.job
0 → 100644
View file @
75041895
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online bl_hdfs_maidian_updates
\ No newline at end of file
pm/doubtful_channel/job/step1_3.job
0 → 100644
View file @
75041895
#step1_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_c_et_ck_click_dimen_d
\ No newline at end of file
pm/doubtful_channel/job/step2.job
0 → 100644
View file @
75041895
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3
command=/home/bi/bi-report/lib/shell/hive doubtful_channel
\ No newline at end of file
pm/doubtful_channel/job/step3.job
0 → 100644
View file @
75041895
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/doubtful_channel/yindanlei@igengmei.com
\ No newline at end of file
pm/doubtful_channel/readme.txt
0 → 100644
View file @
75041895
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