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
6cf4951a
Commit
6cf4951a
authored
Apr 27, 2026
by
fangxingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4b3ec9ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ods_asin_detail.py
Pyspark_job/sqoop_import/ods_asin_detail.py
+6
-4
No files found.
Pyspark_job/sqoop_import/ods_asin_detail.py
View file @
6cf4951a
...
...
@@ -19,9 +19,11 @@ if __name__ == '__main__':
d1
,
d2
=
CommonUtil
.
split_month_week_date
(
date_type
,
date_info
)
d2
=
f
'0{d2}'
if
int
(
d2
)
<
10
else
f
'{d2}'
db_type
=
'postgresql_14'
import_table
=
f
"{site_name}_asin_detail_month_{d1}_{d2}"
if
date_type
==
'day'
:
import_table
=
f
"{site_name}_asin_detail_day_{date_info.replace('-', '_')}"
# import_table = f"{site_name}_asin_detail_month_{d1}_{d2}"
# if date_type == 'day':
# import_table = f"{site_name}_asin_detail_day_{date_info.replace('-', '_')}"
import_table
=
f
"{site_name}_asin_detail_{date_type}_{date_info.replace('-', '_')}"
check_table
=
f
"{site_name}_all_syn_st_{date_type}_{date_info.replace('-', '_')}"
hive_table
=
"ods_asin_detail"
partition_dict
=
{
"site_name"
:
site_name
,
...
...
@@ -49,7 +51,7 @@ if __name__ == '__main__':
def
check_syn
(
engine
):
while
True
:
try
:
sql_check_syn
=
f
"select * from {
import
_table} where state in (1, 2) limit 100"
sql_check_syn
=
f
"select * from {
check
_table} where state in (1, 2) limit 100"
df
=
engine
.
read_sql
(
sql_check_syn
)
if
df
.
shape
[
0
]
>
0
:
print
(
f
"爬虫还未抓完, 等待5分钟继续"
)
...
...
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