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
682eb72a
Commit
682eb72a
authored
Apr 13, 2026
by
hejiangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索词周报告 排名变化率 填充
parent
9a8892d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dim_st_detail_week.py
Pyspark_job/dim/dim_st_detail_week.py
+3
-3
No files found.
Pyspark_job/dim/dim_st_detail_week.py
View file @
682eb72a
...
...
@@ -319,17 +319,17 @@ class DwtStDetailWeek(object):
F
.
when
(
F
.
col
(
'rank_12_week_ago'
)
.
isNull
(),
None
)
.
otherwise
(
F
.
col
(
'rank_12_week_ago'
)
-
F
.
col
(
'rank'
))
)
.
withColumn
(
'rank_change_rate_last_week'
,
F
.
when
(
F
.
col
(
'rank_last_week'
)
.
isNull
(),
None
)
.
otherwise
(
F
.
when
(
F
.
col
(
'rank_last_week'
)
.
isNull
(),
F
.
lit
(
1000
))
.
otherwise
(
# 本周有排名但上周没有,默认增长率1000(新进榜)
F
.
round
((
F
.
col
(
'rank_last_week'
)
-
F
.
col
(
'rank'
))
/
F
.
col
(
'rank_last_week'
),
4
)
)
)
.
withColumn
(
'rank_change_rate_4_week_ago'
,
F
.
when
(
F
.
col
(
'rank_4_week_ago'
)
.
isNull
(),
None
)
.
otherwise
(
F
.
when
(
F
.
col
(
'rank_4_week_ago'
)
.
isNull
(),
F
.
lit
(
1000
))
.
otherwise
(
# 本周有排名但4周前没有,默认增长率1000
F
.
round
((
F
.
col
(
'rank_4_week_ago'
)
-
F
.
col
(
'rank'
))
/
F
.
col
(
'rank_4_week_ago'
),
4
)
)
)
.
withColumn
(
'rank_change_rate_12_week_ago'
,
F
.
when
(
F
.
col
(
'rank_12_week_ago'
)
.
isNull
(),
None
)
.
otherwise
(
F
.
when
(
F
.
col
(
'rank_12_week_ago'
)
.
isNull
(),
F
.
lit
(
1000
))
.
otherwise
(
# 本周有排名但12周前没有,默认增长率1000
F
.
round
((
F
.
col
(
'rank_12_week_ago'
)
-
F
.
col
(
'rank'
))
/
F
.
col
(
'rank_12_week_ago'
),
4
)
)
)
.
cache
()
...
...
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