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
34dfe2ab
Commit
34dfe2ab
authored
Aug 26, 2025
by
fangxingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9c3b513a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
dwt_theme_bsr_orders_new.py
Pyspark_job/dwt/dwt_theme_bsr_orders_new.py
+7
-3
db_util.py
Pyspark_job/utils/db_util.py
+1
-1
No files found.
Pyspark_job/dwt/dwt_theme_bsr_orders_new.py
View file @
34dfe2ab
...
...
@@ -42,10 +42,13 @@ class DwtThemeBsOrders(Templates):
# f"union all " \
# f"select asin, asin_title, bsr_orders, date_info from dwt_flow_asin where site_name='{self.site_name}' and " \
# f"date_type='month' and date_info in ('2023-01', '2023-02', '2023-03', '2023-04', '2023-05', '2023-06');"
sql
=
f
"select asin, asin_title, bsr_orders, date_info from dwt_flow_asin where site_name='{self.site_name}' and "
\
f
"date_type='month' and date_info >= '2023-01' and date_info <= '2023-12';"
#
sql = f"select asin, asin_title, bsr_orders, date_info from dwt_flow_asin where site_name='{self.site_name}' and " \
#
f"date_type='month' and date_info >= '2023-01' and date_info <= '2023-12';"
# f"date_type='month' and date_info >= '2023-01' and date_info <= '2023-01' limit 1000000;"
sql
=
f
"select asin, asin_title, bsr_orders, date_info from dwt_flow_asin where site_name='{self.site_name}' and "
\
f
"date_type='month' and date_info >= '2024-08' and date_info <= '2025-07';"
print
(
"sql:"
,
sql
)
self
.
df_flow
=
self
.
spark
.
sql
(
sql
)
.
cache
()
self
.
df_flow
.
show
(
10
,
truncate
=
False
)
...
...
@@ -186,7 +189,8 @@ class DwtThemeBsOrders(Templates):
self
.
df_save
=
self
.
df_save
.
cache
()
self
.
df_save
.
show
(
50
,
truncate
=
False
)
df
=
self
.
df_save
.
toPandas
()
df
.
to_csv
(
"/root/theme_new_2023.csv"
,
index
=
False
)
# df.to_csv("/root/theme_new_2023.csv", index=False)
df
.
to_csv
(
"/home/fangxingjun/theme_new_202408-202507.csv"
,
index
=
False
)
if
__name__
==
'__main__'
:
...
...
Pyspark_job/utils/db_util.py
View file @
34dfe2ab
...
...
@@ -12,7 +12,7 @@ sys.path.append(os.path.dirname(sys.path[0]))
def
get_redis_h14
():
return
redis
.
Redis
(
host
=
'192.168.10.224'
,
port
=
6379
,
db
=
9
,
password
=
'
fG7#vT6kQ1pX
'
)
return
redis
.
Redis
(
host
=
'192.168.10.224'
,
port
=
6379
,
db
=
9
,
password
=
'
N8#rTp2Xz!Lk6@Vw9qHs4&Yb1Fm0Cj3
'
)
class
DbTypes
(
Enum
):
...
...
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