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
007e6b5a
Commit
007e6b5a
authored
Apr 13, 2026
by
chenyuanjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://47.106.101.75/abel_cjy/Amazon-Selection-Data
into developer
parents
a843829a
823e7cbc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
dim_st_detail_week.py
Pyspark_job/dim/dim_st_detail_week.py
+3
-3
dwd_bsr_nsr_asin_rank_day.py
Pyspark_job/sqoop_export/dwd_bsr_nsr_asin_rank_day.py
+1
-0
No files found.
Pyspark_job/dim/dim_st_detail_week.py
View file @
007e6b5a
...
...
@@ -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
()
...
...
Pyspark_job/sqoop_export/dwd_bsr_nsr_asin_rank_day.py
View file @
007e6b5a
...
...
@@ -34,6 +34,7 @@ if __name__ == '__main__':
engine
=
DBUtil
.
get_db_engine
(
db_type
,
site_name
)
# 根据主表 复制结构 创建天的子表 day_flag 是一个自动计算列,由 is_1_day_flag + is_7_day_flag + is_30_day_flag
DBUtil
.
engine_exec_sql
(
engine
,
f
"""
drop table if exists {export_tb};
create table {export_tb} ( like {export_master_tb} including defaults including constraints );
alter table {export_tb} drop if exists day_flag ;
alter table {export_tb} add column day_flag varchar(10) generated always as (is_1_day_flag + is_7_day_flag + is_30_day_flag) stored;
...
...
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