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
55e58b3a
Commit
55e58b3a
authored
Jul 22, 2026
by
hejiangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
b4de6063
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
dwt_bs_top100.py
Pyspark_job/sqoop_export/dwt_bs_top100.py
+13
-0
dwt_bs_top100_change_rate.py
Pyspark_job/sqoop_export/dwt_bs_top100_change_rate.py
+13
-0
No files found.
Pyspark_job/sqoop_export/dwt_bs_top100.py
View file @
55e58b3a
...
@@ -162,10 +162,23 @@ if __name__ == '__main__':
...
@@ -162,10 +162,23 @@ if __name__ == '__main__':
# 两脚本传同一条 update SQL,谁最后完成都能正确触发。本地/test 运行时该函数自动跳过。
# 两脚本传同一条 update SQL,谁最后完成都能正确触发。本地/test 运行时该函数自动跳过。
# 本功能不像 aba 会在流程启动时预写一条 workflow_everyday,故用 replace INTO 直接插入/覆盖该行(不存在则建、存在则替换)。
# 本功能不像 aba 会在流程启动时预写一条 workflow_everyday,故用 replace INTO 直接插入/覆盖该行(不存在则建、存在则替换)。
# 只有主表+同比环比两个导出都完成时,modify_export_workflow_status 才会执行这条(即页面此时才出现"完成"行)。
# 只有主表+同比环比两个导出都完成时,modify_export_workflow_status 才会执行这条(即页面此时才出现"完成"行)。
# 同一条 SQL 里再拼一条 REPLACE,往 selection.workflow_progress 写"品类调研 计算完成"进度记录:
# 和 workflow_everyday 同一时机(两个导出都完成才触发)、同一次执行、只写 1 条;
# table_name/remark 与 workflow_everyday 一致(table_name 不带月份);status/status_val 用 workflow_progress 自己口径(计算完成/3)。
# engine_exec_sql 支持一次多条语句;created_at/updated_at 用 MySQL NOW() 取执行时刻。
update_workflow_sql
=
f
"""
update_workflow_sql
=
f
"""
replace INTO selection.workflow_everyday
replace INTO selection.workflow_everyday
(site_name, report_date, status, status_val, table_name, date_type, page, is_end, remark, export_db_type)
(site_name, report_date, status, status_val, table_name, date_type, page, is_end, remark, export_db_type)
VALUES('{site_name}', '{date_info}', '导出PG数据库完成', 14, '{site_name}_category_top_analysis', '{date_type}', '品类调研', '是', '品类调研月表', '{db_type}');
VALUES('{site_name}', '{date_info}', '导出PG数据库完成', 14, '{site_name}_category_top_analysis', '{date_type}', '品类调研', '是', '品类调研月表', '{db_type}');
REPLACE INTO selection.workflow_progress
(site_name, page, table_name, date_type, date_info, status, status_val, is_end,
over_date, total, crawling_responsible, calculate_responsible, exhibition_responsible,
remark, created_at, updated_at, kafka_state, kafka_flow_state, freeze_flag,
spider_int, spider_state, up_spider_state)
VALUES('{site_name}', '品类调研', '{site_name}_category_top_analysis', '{date_type}', '{date_info}',
'计算完成', 3, '是', NULL, NULL, NULL, 'hejiangming@yswg.com.cn', NULL, '品类调研月表',
NOW(), NOW(), 1, 1, NULL, 1, 1, 1);
"""
"""
CommonUtil
.
modify_export_workflow_status
(
update_workflow_sql
,
site_name
,
date_type
,
date_info
)
CommonUtil
.
modify_export_workflow_status
(
update_workflow_sql
,
site_name
,
date_type
,
date_info
)
print
(
"success"
)
print
(
"success"
)
Pyspark_job/sqoop_export/dwt_bs_top100_change_rate.py
View file @
55e58b3a
...
@@ -131,10 +131,23 @@ if __name__ == '__main__':
...
@@ -131,10 +131,23 @@ if __name__ == '__main__':
# 两脚本传同一条 update SQL,谁最后完成都能正确触发。本地/test 运行时该函数自动跳过。
# 两脚本传同一条 update SQL,谁最后完成都能正确触发。本地/test 运行时该函数自动跳过。
# 本功能不像 aba 会在流程启动时预写一条 workflow_everyday,故用 replace INTO 直接插入/覆盖该行(不存在则建、存在则替换)。
# 本功能不像 aba 会在流程启动时预写一条 workflow_everyday,故用 replace INTO 直接插入/覆盖该行(不存在则建、存在则替换)。
# 只有主表+同比环比两个导出都完成时,modify_export_workflow_status 才会执行这条(即页面此时才出现"完成"行)。
# 只有主表+同比环比两个导出都完成时,modify_export_workflow_status 才会执行这条(即页面此时才出现"完成"行)。
# 同一条 SQL 里再拼一条 REPLACE,往 selection.workflow_progress 写"品类调研 计算完成"进度记录:
# 和 workflow_everyday 同一时机(两个导出都完成才触发)、同一次执行、只写 1 条;
# table_name/remark 与 workflow_everyday 一致(table_name 不带月份);status/status_val 用 workflow_progress 自己口径(计算完成/3)。
# 两个导出脚本这条 SQL 完全一致,谁最后完成谁触发,结果只 1 条。created_at/updated_at 用 MySQL NOW()。
update_workflow_sql
=
f
"""
update_workflow_sql
=
f
"""
replace INTO selection.workflow_everyday
replace INTO selection.workflow_everyday
(site_name, report_date, status, status_val, table_name, date_type, page, is_end, remark, export_db_type)
(site_name, report_date, status, status_val, table_name, date_type, page, is_end, remark, export_db_type)
VALUES('{site_name}', '{date_info}', '导出PG数据库完成', 14, '{site_name}_category_top_analysis', '{date_type}', '品类调研', '是', '品类调研月表', '{db_type}');
VALUES('{site_name}', '{date_info}', '导出PG数据库完成', 14, '{site_name}_category_top_analysis', '{date_type}', '品类调研', '是', '品类调研月表', '{db_type}');
REPLACE INTO selection.workflow_progress
(site_name, page, table_name, date_type, date_info, status, status_val, is_end,
over_date, total, crawling_responsible, calculate_responsible, exhibition_responsible,
remark, created_at, updated_at, kafka_state, kafka_flow_state, freeze_flag,
spider_int, spider_state, up_spider_state)
VALUES('{site_name}', '品类调研', '{site_name}_category_top_analysis', '{date_type}', '{date_info}',
'计算完成', 3, '是', NULL, NULL, NULL, 'hejiangming@yswg.com.cn', NULL, '品类调研月表',
NOW(), NOW(), 1, 1, NULL, 1, 1, 1);
"""
"""
CommonUtil
.
modify_export_workflow_status
(
update_workflow_sql
,
site_name
,
date_type
,
date_info
)
CommonUtil
.
modify_export_workflow_status
(
update_workflow_sql
,
site_name
,
date_type
,
date_info
)
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