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
0f3fa922
Commit
0f3fa922
authored
Jun 08, 2026
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c3f34ac5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
export_need_profit_rate.py
Pyspark_job/script/export_need_profit_rate.py
+3
-1
No files found.
Pyspark_job/script/export_need_profit_rate.py
View file @
0f3fa922
...
...
@@ -190,7 +190,9 @@ class ExportNeedProfitRate(object):
df_result
=
df_need
\
.
join
(
df_cate
,
on
=
'category_first_id'
,
how
=
'left'
)
\
.
withColumn
(
'source_month'
,
F
.
date_format
(
F
.
col
(
'asin_crawl_date'
),
'yyyy-MM'
))
\
.
withColumn
(
'asin_crawl_date'
,
F
.
coalesce
(
F
.
col
(
'asin_crawl_date'
),
F
.
current_timestamp
()))
\
.
withColumn
(
'source_month'
,
F
.
coalesce
(
F
.
date_format
(
F
.
col
(
'asin_crawl_date'
),
'yyyy-MM'
),
F
.
date_format
(
F
.
current_timestamp
(),
'yyyy-MM'
)))
\
.
withColumn
(
'part_key'
,
F
.
ntile
(
50
)
.
over
(
Window
.
orderBy
(
F
.
rand
())))
\
.
select
(
'asin'
,
'price'
,
'category'
,
...
...
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