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
c9eef618
Commit
c9eef618
authored
Oct 09, 2026
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流量选品-account_name解析优化-与account_id配套
parent
3802fae9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dwt_flow_asin.py
Pyspark_job/dwt/dwt_flow_asin.py
+3
-3
No files found.
Pyspark_job/dwt/dwt_flow_asin.py
View file @
c9eef618
...
...
@@ -545,11 +545,11 @@ class DwtFlowAsin(Templates):
.
withColumnRenamed
(
'account_name'
,
'fd_account_name'
)
# 1. 关联df2,用于填充dim表中account_id和account_name为空的情况
self
.
df_asin_detail
=
self
.
df_asin_detail
.
join
(
df_asin_account
,
on
=
[
'asin'
],
how
=
'left'
)
# 2. 优先使用dim表
中的数据(已从seller_json提取),为空则使用df2的
数据
# 2. 优先使用dim表
数据,account_id为空时account_id和account_name整体取fd表
数据
self
.
df_asin_detail
=
self
.
df_asin_detail
.
withColumn
(
"account_
id"
,
F
.
coalesce
(
F
.
col
(
"account_id"
),
F
.
col
(
"fd_account_id
"
))
"account_
name"
,
F
.
when
(
F
.
col
(
"account_id"
)
.
isNull
(),
F
.
col
(
"fd_account_name"
))
.
otherwise
(
F
.
col
(
"account_name
"
))
)
.
withColumn
(
"account_
name"
,
F
.
coalesce
(
F
.
col
(
"account_name"
),
F
.
col
(
"fd_account_name
"
))
"account_
id"
,
F
.
when
(
F
.
col
(
"account_id"
)
.
isNull
(),
F
.
col
(
"fd_account_id"
))
.
otherwise
(
F
.
col
(
"account_id
"
))
)
.
drop
(
"fd_account_id"
,
"fd_account_name"
)
# 3. 关联df1获取seller_country_name
self
.
df_asin_detail
=
self
.
df_asin_detail
.
join
(
df_seller_country
,
on
=
[
'account_id'
],
how
=
'left'
)
...
...
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