Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Amazon-Selection-Data
Overview
Overview
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
abel_cjy
Amazon-Selection-Data
Commits
16cb7ae2
Commit
16cb7ae2
authored
Apr 24, 2026
by
fangxingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d3a03b84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
site_search_term_to_syn.py
Pyspark_job/listen_program/site_search_term_to_syn.py
+30
-0
No files found.
Pyspark_job/listen_program/site_search_term_to_syn.py
View file @
16cb7ae2
...
@@ -88,9 +88,39 @@ class Integrate_search_term():
...
@@ -88,9 +88,39 @@ class Integrate_search_term():
conn
.
execute
(
deletesql
)
conn
.
execute
(
deletesql
)
deletesql
=
f
"DELETE from {self.site_name}_search_term_syn where state = 1 and date_info='{self.date_info}'"
deletesql
=
f
"DELETE from {self.site_name}_search_term_syn where state = 1 and date_info='{self.date_info}'"
conn
.
execute
(
deletesql
)
conn
.
execute
(
deletesql
)
with
self
.
engine_mysql
.
begin
()
as
conn
:
update_sql_workflow
=
f
"""
INSERT INTO workflow_manager
(
site_name,
date_type,
date_info,
spider_name,
spider_is_ready,
spider_state
)
VALUES
(
'{self.site_name}',
'month',
'{self.date_info}',
'us_spider_st',
'yes',
1
)
ON DUPLICATE KEY UPDATE
spider_is_ready = VALUES(spider_is_ready),
spider_state = VALUES(spider_state);
"""
print
(
f
"workflow_manager进度表---重置爬虫的搜索词抓取进度: {update_sql_workflow}"
)
conn
.
execute
(
update_sql_workflow
)
data_df
.
to_sql
(
f
'{self.site_name}_search_term_month_syn'
,
con
=
self
.
engine_pg
,
if_exists
=
"append"
,
data_df
.
to_sql
(
f
'{self.site_name}_search_term_month_syn'
,
con
=
self
.
engine_pg
,
if_exists
=
"append"
,
index
=
False
)
index
=
False
)
else
:
else
:
with
self
.
engine_pg
.
begin
()
as
conn
:
with
self
.
engine_pg
.
begin
()
as
conn
:
delete_sql
=
f
"DELETE from {self.site_name}_search_term_syn where date_info<'{self.date_info_pre}' and state not in (1,2)"
delete_sql
=
f
"DELETE from {self.site_name}_search_term_syn where date_info<'{self.date_info_pre}' and state not in (1,2)"
...
...
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