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
cff45bfa
Commit
cff45bfa
authored
May 15, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add daily_content_data codes
parent
f7daea9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
daily_content_data.sql
sqls/daily_content_data/daily_content_data.sql
+9
-10
No files found.
sqls/daily_content_data/daily_content_data.sql
View file @
cff45bfa
...
@@ -191,7 +191,7 @@ LEFT JOIN
...
@@ -191,7 +191,7 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
WHERE
spam_pv
.
device_id
IS
NULL
...
@@ -275,7 +275,7 @@ LEFT JOIN
...
@@ -275,7 +275,7 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
WHERE
spam_pv
.
device_id
IS
NULL
...
@@ -345,10 +345,9 @@ LEFT JOIN
...
@@ -345,10 +345,9 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
LEFT
JOIN
LEFT
JOIN
(
--活跃设备
(
--活跃设备
SELECT
device_id
SELECT
device_id
...
@@ -358,7 +357,7 @@ LEFT JOIN
...
@@ -358,7 +357,7 @@ LEFT JOIN
AND
partition_date
<
regexp_replace
((
current_date
),
'-'
,
''
)
AND
partition_date
<
regexp_replace
((
current_date
),
'-'
,
''
)
)
t3
)
t3
ON
t2
.
cl_id
=
t3
.
device_id
ON
t2
.
cl_id
=
t3
.
device_id
WHERE
spam_pv
.
cl
_id
IS
NULL
WHERE
spam_pv
.
device
_id
IS
NULL
)
t4
)
t4
LATERAL
VIEW
explode
(
t4
.
channel
)
t5
AS
channel
LATERAL
VIEW
explode
(
t4
.
channel
)
t5
AS
channel
GROUP
BY
regexp_replace
(
partition_date
,
'-'
,
''
),
device_type
,
active_type
,
t5
.
channel
GROUP
BY
regexp_replace
(
partition_date
,
'-'
,
''
),
device_type
,
active_type
,
t5
.
channel
...
@@ -423,7 +422,7 @@ LEFT JOIN
...
@@ -423,7 +422,7 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
LEFT
JOIN
LEFT
JOIN
...
@@ -436,7 +435,7 @@ LEFT JOIN
...
@@ -436,7 +435,7 @@ LEFT JOIN
)
t3
)
t3
on
t2
.
partition_date
=
t3
.
partition_date
on
t2
.
partition_date
=
t3
.
partition_date
AND
t2
.
cl_id
=
t3
.
device_id
AND
t2
.
cl_id
=
t3
.
device_id
WHERE
spam_pv
.
cl
_id
IS
NULL
WHERE
spam_pv
.
device
_id
IS
NULL
)
t4
)
t4
LATERAL
VIEW
explode
(
t4
.
channel
)
t5
AS
channel
LATERAL
VIEW
explode
(
t4
.
channel
)
t5
AS
channel
GROUP
BY
partition_date
,
device_type
,
active_type
,
t5
.
channel
GROUP
BY
partition_date
,
device_type
,
active_type
,
t5
.
channel
...
@@ -578,7 +577,7 @@ LEFT JOIN
...
@@ -578,7 +577,7 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
WHERE
spam_pv
.
device_id
IS
NULL
...
@@ -728,7 +727,7 @@ LEFT JOIN
...
@@ -728,7 +727,7 @@ LEFT JOIN
group
by
a
.
partition_date
,
user_id
group
by
a
.
partition_date
,
user_id
)
t4
)
t4
on
t3
.
user_id
=
t4
.
user_id
on
t3
.
user_id
=
t4
.
user_id
and
t3
.
reply
_date
=
t4
.
partition_date
and
t3
.
create
_date
=
t4
.
partition_date
LEFT
JOIN
LEFT
JOIN
...
@@ -1051,7 +1050,7 @@ LEFT JOIN
...
@@ -1051,7 +1050,7 @@ LEFT JOIN
(
-- 去掉疑似机构刷量的PV和UV
(
-- 去掉疑似机构刷量的PV和UV
select
distinct
device_id
select
distinct
device_id
from
ml
.
ml_d_ct_dv_devicespam_d
from
ml
.
ml_d_ct_dv_devicespam_d
where
partition_day
=
'${partition_date}'
where
partition_day
=
regexp_replace
((
current_date
-
interval
'1'
day
),
'-'
,
''
)
)
spam_pv
)
spam_pv
on
t2
.
cl_id
=
spam_pv
.
device_id
on
t2
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
WHERE
spam_pv
.
device_id
IS
NULL
...
...
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