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
4b3ec9ba
Commit
4b3ec9ba
authored
Apr 27, 2026
by
fangxingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e1a3ca1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
ods_asin_detail.py
Pyspark_job/sqoop_import/ods_asin_detail.py
+24
-0
No files found.
Pyspark_job/sqoop_import/ods_asin_detail.py
View file @
4b3ec9ba
import
os
import
os
import
sys
import
sys
import
time
import
traceback
sys
.
path
.
append
(
os
.
path
.
dirname
(
sys
.
path
[
0
]))
sys
.
path
.
append
(
os
.
path
.
dirname
(
sys
.
path
[
0
]))
...
@@ -44,6 +46,28 @@ if __name__ == '__main__':
...
@@ -44,6 +46,28 @@ if __name__ == '__main__':
db_type
=
db_type
db_type
=
db_type
)
)
def
check_syn
(
engine
):
while
True
:
try
:
sql_check_syn
=
f
"select * from {import_table} where state in (1, 2) limit 100"
df
=
engine
.
read_sql
(
sql_check_syn
)
if
df
.
shape
[
0
]
>
0
:
print
(
f
"爬虫还未抓完, 等待5分钟继续"
)
time
.
sleep
(
300
)
continue
else
:
print
(
"爬虫已经全部抓取完成, 可以同步数据"
)
break
except
Exception
as
e
:
print
(
f
"检查asin是否全部抓取完成报错, 报错信息: {e}, {traceback.format_exc()}"
)
time
.
sleep
(
300
)
engine
=
get_remote_engine
(
site_name
=
site_name
,
db_type
=
db_type
)
check_syn
(
engine
=
engine
)
query
=
f
"""
query
=
f
"""
SELECT
SELECT
id,
id,
...
...
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