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
720b17c4
Commit
720b17c4
authored
Jun 29, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
86a56967
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
45 deletions
+72
-45
daily_content_data_insert.sql
sqls/daily_content_data_insert/daily_content_data_insert.sql
+72
-45
No files found.
sqls/daily_content_data_insert/daily_content_data_insert.sql
View file @
720b17c4
...
@@ -97,11 +97,14 @@ FROM
...
@@ -97,11 +97,14 @@ FROM
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -162,11 +165,14 @@ LEFT JOIN
...
@@ -162,11 +165,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -252,11 +258,14 @@ LEFT JOIN
...
@@ -252,11 +258,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -328,11 +337,14 @@ LEFT JOIN
...
@@ -328,11 +337,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -416,11 +428,14 @@ LEFT JOIN
...
@@ -416,11 +428,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -525,11 +540,14 @@ LEFT JOIN
...
@@ -525,11 +540,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -657,11 +675,14 @@ LEFT JOIN
...
@@ -657,11 +675,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -849,11 +870,14 @@ LEFT JOIN
...
@@ -849,11 +870,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
@@ -1043,11 +1067,14 @@ LEFT JOIN
...
@@ -1043,11 +1067,14 @@ LEFT JOIN
,
m
.
device_id
,
device_os_type
,
m
.
device_id
,
device_os_type
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
,
case
WHEN
active_type
=
'4'
THEN
'老活跃设备'
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
WHEN
active_type
in
(
'1'
,
'2'
)
then
'新增设备'
END
as
active_type
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
THEN
'可疑'
,
array
(
CASE
WHEN
first_channel_source_type
like
'%xinyouxingkong%'
or
a
.
device_id
is
not
NULL
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
first_channel_source_type
in
(
'promotion_aisi'
,
'promotion_jingmeng_jingmeng01'
,
'promotion_koomobi_km00'
,
'promotion_koomobi_km01'
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
,
'promotion_longyuzhixing_lyzx01'
,
'promotion_longyuzhixing_seedpi'
,
'promotion_longyuzhixing_lyzx04'
,
'promotion_longyuzhixing_lyzx06'
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
,
'promotion_mailuo_mailuo01'
,
'promotion_mailuo_mailuo03'
)
THEN
'可疑'
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
WHEN
(
partition_date
>=
'20190601'
and
tmp
.
col2
=
'AI'
)
or
(
partition_date
<
'20200301'
AND
partition_date
>=
'20190601'
and
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
partition_date
>=
'20200601'
and
((
first_channel_source_type
like
'promotion_toutiao_jy%'
)
or
(
first_channel_source_type
like
'dyand%'
)
or
(
first_channel_source_type
like
'douyin%'
)))
THEN
'AI'
ELSE
'其他'
END
,
'合计'
)
as
channel
FROM
online
.
ml_device_day_active_status
m
FROM
online
.
ml_device_day_active_status
m
LEFT
JOIN
LEFT
JOIN
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
(
SELECT
col1
,
col2
--col1:子渠道,col2:是否属于AI,col3:标识
...
...
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