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
a7e6d6ef
Commit
a7e6d6ef
authored
Jul 30, 2026
by
hejiangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索词更换店铺dim数据源
parent
b43351ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
dwt_aba_st_analytics.py
Pyspark_job/dwt/dwt_aba_st_analytics.py
+7
-7
dwt_aba_st_analytics_report.py
Pyspark_job/dwt/dwt_aba_st_analytics_report.py
+6
-6
No files found.
Pyspark_job/dwt/dwt_aba_st_analytics.py
View file @
a7e6d6ef
...
...
@@ -365,9 +365,9 @@ class DwtAbaStAnalytics(Templates):
sql
=
f
"""
select
asin,
concat_ws(
\"
,
\"
,collect_list(cast(f
d_country_name as string))) as country_name
from dim_f
d_asin_info
where site_name = '{self.site_name}'
concat_ws(
\"
,
\"
,collect_list(cast(f
b_country_name as string))) as country_name
from dim_f
b_asin_info
where site_name = '{self.site_name}'
and date_type = '{self.date_type}' and date_info = '{self.date_info}'
group by asin;
"""
self
.
df_seller_asin_country
=
self
.
spark
.
sql
(
sqlQuery
=
sql
)
...
...
@@ -379,10 +379,10 @@ class DwtAbaStAnalytics(Templates):
sql
=
f
"""
select
asin,
fd_unique
as account_id,
f
d_country_name as country_name
from dim_f
d_asin_info
where site_name = '{self.site_name}'
seller_id
as account_id,
f
b_country_name as country_name
from dim_f
b_asin_info
where site_name = '{self.site_name}'
and date_type = '{self.date_type}' and date_info = '{self.date_info}'
"""
self
.
df_seller_asin_info
=
self
.
spark
.
sql
(
sqlQuery
=
sql
)
self
.
df_seller_asin_info
=
self
.
df_seller_asin_info
.
drop_duplicates
([
'asin'
])
.
repartition
(
80
,
'asin'
)
.
cache
()
...
...
Pyspark_job/dwt/dwt_aba_st_analytics_report.py
View file @
a7e6d6ef
...
...
@@ -327,13 +327,13 @@ class DwtAbaStAnalyticsReport(Templates):
print
(
"1.7 读取dim_seller_asin_history_info系列表"
)
sql
=
f
"""
select asin,
case when upper(f
d_country_name) = 'US' then 'US'
when upper(f
d_country_name) = 'CN' then 'CN'
when upper(f
d_country_name) = 'HK' then 'HK'
when upper(f
d_country_name) = 'FR' then 'FR'
when upper(f
d_country_name) = 'DE' then 'DE'
case when upper(f
b_country_name) = 'US' then 'US'
when upper(f
b_country_name) = 'CN' then 'CN'
when upper(f
b_country_name) = 'HK' then 'HK'
when upper(f
b_country_name) = 'FR' then 'FR'
when upper(f
b_country_name) = 'DE' then 'DE'
else 'OTHER' end as seller_name
from dim_f
d_asin_info where site_name = '{self.site_name
}';
from dim_f
b_asin_info where site_name = '{self.site_name}' and date_type = '{self.date_type}' and date_info = '{self.date_info
}';
"""
print
(
"sql:"
,
sql
)
self
.
df_seller_asin
=
self
.
spark
.
sql
(
sql
)
.
repartition
(
80
,
'asin'
)
.
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