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
35da7e22
Commit
35da7e22
authored
Oct 12, 2026
by
fangxingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
eb17e1ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
ods_keepa_finder_asin.py
Pyspark_job/sqoop_import/ods_keepa_finder_asin.py
+19
-4
No files found.
Pyspark_job/sqoop_import/ods_keepa_finder_asin.py
View file @
35da7e22
...
@@ -17,6 +17,8 @@ date_type = sys.argv[2] # 参数2:类型:day/week/4_week/month/quarter
...
@@ -17,6 +17,8 @@ date_type = sys.argv[2] # 参数2:类型:day/week/4_week/month/quarter
date_info
=
sys
.
argv
[
3
]
# 参数3:年-月-日/年-周/年-月/年-季, 比如: 2022-1
date_info
=
sys
.
argv
[
3
]
# 参数3:年-月-日/年-周/年-月/年-季, 比如: 2022-1
db_type
=
"mysql"
db_type
=
"mysql"
if
date_type
==
'week'
:
db_type
=
'doris'
engine
=
get_remote_engine
(
engine
=
get_remote_engine
(
site_name
=
site_name
,
site_name
=
site_name
,
...
@@ -29,12 +31,25 @@ partition_dict = {
...
@@ -29,12 +31,25 @@ partition_dict = {
"date_type"
:
date_type
,
"date_type"
:
date_type
,
"date_info"
:
date_info
,
"date_info"
:
date_info
,
}
}
sql_query
=
f
"select id, request_id, asin, tracking_since from keepa_finder_asin where 1=1 "
\
if
date_type
==
'week'
:
# db_type = 'doris'
sql_query
=
f
"select null as id, null as request_id, asin, update_time as tracking_since from keepa_finder_asin where 1=1 "
\
f
"and
\
$CONDITIONS"
f
"and
\
$CONDITIONS"
engine
.
sqoop_raw_import
(
query
=
sql_query
,
hive_table
=
hive_table
,
partitions
=
partition_dict
,
m
=
1
,
)
is_saturday_flag
=
is_saturday
(
date_info
)
else
:
sql_query
=
f
"select id, request_id, asin, tracking_since from keepa_finder_asin where 1=1 "
\
f
"and
\
$CONDITIONS"
if
is_saturday_flag
:
is_saturday_flag
=
is_saturday
(
date_info
)
if
is_saturday_flag
:
print
(
f
"{date_info}是周六, 因此需要进行导入"
)
print
(
f
"{date_info}是周六, 因此需要进行导入"
)
engine
.
sqoop_raw_import
(
engine
.
sqoop_raw_import
(
query
=
sql_query
,
query
=
sql_query
,
...
@@ -42,7 +57,7 @@ if is_saturday_flag:
...
@@ -42,7 +57,7 @@ if is_saturday_flag:
partitions
=
partition_dict
,
partitions
=
partition_dict
,
m
=
1
,
m
=
1
,
)
)
else
:
else
:
print
(
f
"{date_info}不是周六, 因此不需要进行导入"
)
print
(
f
"{date_info}不是周六, 因此不需要进行导入"
)
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