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
10eb734f
Commit
10eb734f
authored
Feb 03, 2026
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
80aaf611
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
dim_keepa_asin_info.py
Pyspark_job/dim/dim_keepa_asin_info.py
+4
-2
ods_keepa_asin_detail.py
Pyspark_job/sqoop_import/ods_keepa_asin_detail.py
+2
-1
No files found.
Pyspark_job/dim/dim_keepa_asin_info.py
View file @
10eb734f
...
@@ -106,7 +106,9 @@ class DimKeepaAsinInfo(object):
...
@@ -106,7 +106,9 @@ class DimKeepaAsinInfo(object):
"site_name"
,
F
.
lit
(
self
.
site_name
)
"site_name"
,
F
.
lit
(
self
.
site_name
)
)
.
withColumn
(
)
.
withColumn
(
"date_info"
,
F
.
lit
(
self
.
date_info
)
"date_info"
,
F
.
lit
(
self
.
date_info
)
)
.
repartition
(
50
)
)
.
repartition
(
50
)
.
cache
()
new_count
=
self
.
df_save
.
count
()
old_count
=
self
.
df_keepa_asin_history
.
count
()
hive_tb
=
"dim_keepa_asin_info"
hive_tb
=
"dim_keepa_asin_info"
partition_dict
=
{
partition_dict
=
{
"site_name"
:
self
.
site_name
,
"site_name"
:
self
.
site_name
,
...
@@ -118,7 +120,7 @@ class DimKeepaAsinInfo(object):
...
@@ -118,7 +120,7 @@ class DimKeepaAsinInfo(object):
self
.
df_save
.
write
.
saveAsTable
(
name
=
hive_tb
,
format
=
'hive'
,
mode
=
'append'
,
partitionBy
=
partition_by
)
self
.
df_save
.
write
.
saveAsTable
(
name
=
hive_tb
,
format
=
'hive'
,
mode
=
'append'
,
partitionBy
=
partition_by
)
print
(
"success!"
)
print
(
"success!"
)
if
self
.
df_save
.
count
()
>=
self
.
df_keepa_asin_history
.
count
()
:
if
new_count
>=
old_count
:
print
(
f
"正在删除历史分区数据"
)
print
(
f
"正在删除历史分区数据"
)
self
.
spark
.
sql
(
f
"""
self
.
spark
.
sql
(
f
"""
ALTER TABLE {hive_tb} DROP IF EXISTS PARTITION (site_name='{self.site_name}', date_info='{self.last_date_info}')
ALTER TABLE {hive_tb} DROP IF EXISTS PARTITION (site_name='{self.site_name}', date_info='{self.last_date_info}')
...
...
Pyspark_job/sqoop_import/ods_keepa_asin_detail.py
View file @
10eb734f
...
@@ -40,7 +40,8 @@ if __name__ == '__main__':
...
@@ -40,7 +40,8 @@ if __name__ == '__main__':
query
=
query
,
query
=
query
,
hive_table
=
hive_table
,
hive_table
=
hive_table
,
hdfs_path
=
hdfs_path
,
hdfs_path
=
hdfs_path
,
partitions
=
partition_dict
partitions
=
partition_dict
,
check_count
=
False
)
)
pass
pass
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