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
17c72656
Commit
17c72656
authored
Sep 19, 2025
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺报表数据-新增字段-卖家公司信息
parent
3797377f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
63 deletions
+106
-63
dwt_fb_base_report.py
Pyspark_job/dwt/dwt_fb_base_report.py
+99
-51
dwt_fb_base_report.py
Pyspark_job/sqoop_export/dwt_fb_base_report.py
+7
-12
No files found.
Pyspark_job/dwt/dwt_fb_base_report.py
View file @
17c72656
This diff is collapsed.
Click to expand it.
Pyspark_job/sqoop_export/dwt_fb_base_report.py
View file @
17c72656
...
...
@@ -5,7 +5,7 @@ sys.path.append(os.path.dirname(sys.path[0]))
from
utils.db_util
import
DBUtil
from
utils.ssh_util
import
SSHUtil
from
utils.common_util
import
CommonUtil
,
DateTypes
from
utils.common_util
import
CommonUtil
if
__name__
==
'__main__'
:
site_name
=
CommonUtil
.
get_sys_arg
(
1
,
None
)
...
...
@@ -23,8 +23,6 @@ if __name__ == '__main__':
db_type
=
'postgresql_test'
print
(
"导出到测试库中"
)
else
:
# db_type = "postgresql"
# print("导出到PG库中")
db_type
=
"postgresql_cluster"
print
(
"导出到PG集群库库中"
)
...
...
@@ -38,7 +36,6 @@ if __name__ == '__main__':
# 获取数据库连接
engine
=
DBUtil
.
get_db_engine
(
db_type
,
site_name
)
# 保证幂等性,先删除原始表同周期的数据
sql
=
f
"""
drop table if exists {export_tb};
...
...
@@ -89,7 +86,9 @@ if __name__ == '__main__':
"fb_new_asin_num_type"
,
"fb_new_asin_rate_type"
,
"usr_mask_type"
,
"usr_mask_progress"
"usr_mask_progress"
,
"business_name"
,
"business_addr"
],
partition_dict
=
{
"site_name"
:
site_name
,
...
...
@@ -101,7 +100,6 @@ if __name__ == '__main__':
client
=
SSHUtil
.
get_ssh_client
()
SSHUtil
.
exec_command_async
(
client
,
sh_report
,
ignore_err
=
False
)
client
.
close
()
# 创建索引并交换分区
DBUtil
.
add_pg_part
(
...
...
@@ -116,14 +114,11 @@ if __name__ == '__main__':
)
update_workflow_sql
=
f
"""
update selection.workflow_progress set `status`='导出pg集群完成', status_val=6, over_date=CURRENT_TIME, is_end='是' where page='店铺Feedback'
and `date_info`='{date_info}' and date_type='{date_type}' and site_name='{site_name}'
"""
update selection.workflow_progress set `status`='导出pg集群完成', status_val=6, over_date=CURRENT_TIME, is_end='是' where page='店铺Feedback'
and `date_info`='{date_info}' and date_type='{date_type}' and site_name='{site_name}'
"""
CommonUtil
.
modify_export_workflow_status
(
update_workflow_sql
,
site_name
,
date_type
,
date_info
)
# 关闭链接
engine
.
dispose
()
print
(
"success"
)
print
(
"success"
)
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