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
1cc20431
Commit
1cc20431
authored
Sep 04, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
20dd3f76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
search_strategy_d.py
task/search_strategy_d.py
+3
-1
No files found.
task/search_strategy_d.py
View file @
1cc20431
...
@@ -132,6 +132,7 @@ for t in range(1, task_days):
...
@@ -132,6 +132,7 @@ for t in range(1, task_days):
print
(
sql_dev_device_id
)
print
(
sql_dev_device_id
)
dev_df
=
spark
.
sql
(
sql_dev_device_id
)
dev_df
=
spark
.
sql
(
sql_dev_device_id
)
dev_df_view
=
dev_df
.
createOrReplaceTempView
(
"dev_view"
)
dev_df_view
=
dev_df
.
createOrReplaceTempView
(
"dev_view"
)
dev_df
.
cache
()
dev_df
.
show
(
1
)
dev_df
.
show
(
1
)
sql_res
=
dev_df
.
collect
()
sql_res
=
dev_df
.
collect
()
for
res
in
sql_res
:
for
res
in
sql_res
:
...
@@ -154,6 +155,7 @@ for t in range(1, task_days):
...
@@ -154,6 +155,7 @@ for t in range(1, task_days):
spam_pv_view
=
spam_pv_df
.
createOrReplaceTempView
(
"spam_pv"
)
spam_pv_view
=
spam_pv_df
.
createOrReplaceTempView
(
"spam_pv"
)
spam_pv_df
.
show
(
1
)
spam_pv_df
.
show
(
1
)
sql_res
=
spam_pv_df
.
collect
()
sql_res
=
spam_pv_df
.
collect
()
spam_pv_df
.
cache
()
for
res
in
sql_res
:
for
res
in
sql_res
:
print
(
res
)
print
(
res
)
...
@@ -365,7 +367,7 @@ LEFT JOIN
...
@@ -365,7 +367,7 @@ LEFT JOIN
LEFT JOIN dev_view
LEFT JOIN dev_view
on t1.partition_date=dev_view.partition_date and t1.cl_id=dev_view.device_id
on t1.partition_date=dev_view.partition_date and t1.cl_id=dev_view.device_id
WHERE (spam_pv.device_id IS NULL or spam_pv.device_id ='')
WHERE (spam_pv.device_id IS NULL or spam_pv.device_id ='')
and (dev_view.device_id is
null
or dev_view.device_id ='')
and (dev_view.device_id is
NULL
or dev_view.device_id ='')
GROUP BY t1.partition_date,active_type,device_os_type,channel
GROUP BY t1.partition_date,active_type,device_os_type,channel
)t4
)t4
on t3.partition_date=t4.partition_date and t3.active_type=t4.active_type and t3.device_os_type = t4.device_os_type AND t3.channel = t4.channel
on t3.partition_date=t4.partition_date and t3.active_type=t4.active_type and t3.device_os_type = t4.device_os_type AND t3.channel = t4.channel
...
...
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