Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
黎涛
meta_base_code
Commits
d9d98a28
Commit
d9d98a28
authored
Aug 26, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
46b65c43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
core_indicators_monitoring.py
task/core_indicators_monitoring.py
+16
-17
No files found.
task/core_indicators_monitoring.py
View file @
d9d98a28
...
...
@@ -68,7 +68,7 @@ for t in range(0, task_days):
last_30_day_str
=
(
now
+
datetime
.
timedelta
(
days
=-
30
))
.
strftime
(
"
%
Y
%
m
%
d"
)
today_str
=
now
.
strftime
(
"
%
Y
%
m
%
d"
)
yesterday_str
=
(
now
+
datetime
.
timedelta
(
days
=-
1
))
.
strftime
(
"
%
Y
%
m
%
d"
)
one_week_age_str
=
(
now
+
datetime
.
timedelta
(
days
=-
90
))
.
strftime
(
"
%
Y
%
m
%
d"
)
one_week_age_str
=
(
now
+
datetime
.
timedelta
(
days
=-
7
))
.
strftime
(
"
%
Y
%
m
%
d"
)
sql
=
"""
SELECT
partition_date
...
...
@@ -103,20 +103,20 @@ FROM
,coalesce(t1.device_os_type,t2.device_os_type,t3.device_os_type,t4.device_os_type,t5.device_os_type,t6.device_os_type) as device_os_type
,coalesce(t1.channel,t2.channel,t3.channel,t4.channel,t5.channel,t6.channel) as channel
,coalesce(t1.dau,0) as dau
,coalesce(t3.all_search_uv,0) as all_search_uv
,coalesce(t3.all_search_pv,0) as all_search_pv
,coalesce(t4.search_home_uv,0) as search_home_uv
,coalesce(t4.search_home_pv,0) as search_home_pv
,coalesce(t3.sug_search_uv_726,0) as sug_search_uv_726
,coalesce(t3.sug_search_pv_726,0) as sug_search_pv_726
,coalesce(t2.all_search_click_uv_724,0) as all_search_click_uv_724
,coalesce(t2.all_search_click_pv_724,0) as all_search_click_pv_724
,coalesce(t4.referrer_search_hexin_pv,0) as referrer_search_hexin_pv
,coalesce(t4.referrer_search_welfare_pv,0) as referrer_search_welfare_pv
,coalesce(t4.referrer_search_neirong_pv,0) as referrer_search_neirong_pv
,coalesce(t5.search_hexin_two_pv,0) as search_hexin_two_pv
,coalesce(t5.search_neirong_two_pv,0) as search_neirong_two_pv
,coalesce(t4.referrer_search_neirong_uv_1000,0) as referrer_search_neirong_uv_1000
,coalesce(t3.all_search_uv,0) as all_search_uv
,coalesce(t3.all_search_pv,0) as all_search_pv
,coalesce(t4.search_home_uv,0) as search_home_uv
,coalesce(t4.search_home_pv,0) as search_home_pv
,coalesce(t3.sug_search_uv_726,0) as sug_search_uv_726
,coalesce(t3.sug_search_pv_726,0) as sug_search_pv_726
,coalesce(t2.all_search_click_uv_724,0) as all_search_click_uv_724
,coalesce(t2.all_search_click_pv_724,0) as all_search_click_pv_724
,coalesce(t4.referrer_search_hexin_pv,0) as referrer_search_hexin_pv
,coalesce(t4.referrer_search_welfare_pv,0) as referrer_search_welfare_pv
,coalesce(t4.referrer_search_neirong_pv,0) as referrer_search_neirong_pv
,coalesce(t5.search_hexin_two_pv,0) as search_hexin_two_pv
,coalesce(t5.search_neirong_two_pv,0) as search_neirong_two_pv
,coalesce(t4.referrer_search_neirong_uv_1000,0) as referrer_search_neirong_uv_1000
,coalesce(t4.referrer_search_neirong_pagestay,0) as referrer_search_neirong_pagestay
,coalesce(t6.sug_out_uv_726,0) as sug_out_uv_726
,coalesce(t6.sug_out_pv_726,0) as sug_out_pv_726
...
...
@@ -395,7 +395,7 @@ FROM
AND t4.device_os_type = t1.device_os_type
AND t4.channel = t1.channel
full JOIN
(
(
SELECT
card_click.partition_date as partition_date
,active_type
...
...
@@ -535,7 +535,6 @@ FROM
AND t6.device_os_type = t1.device_os_type
AND t6.channel = t1.channel
)t
"""
.
format
(
start_date
=
one_week_age_str
,
end_date
=
today_str
,
)
device_df
=
spark
.
sql
(
sql
)
...
...
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