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
a0670622
Commit
a0670622
authored
Jul 01, 2025
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
db06cf50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
export_dwt_asin_related_traffic.py
Pyspark_job/sqoop_export/export_dwt_asin_related_traffic.py
+22
-11
No files found.
Pyspark_job/sqoop_export/export_dwt_asin_related_traffic.py
View file @
a0670622
...
@@ -34,7 +34,8 @@ if __name__ == '__main__':
...
@@ -34,7 +34,8 @@ if __name__ == '__main__':
report_type
=
date_type
report_type
=
date_type
report_date
=
date_info
report_date
=
date_info
elif
date_type
==
'month_week'
:
elif
date_type
==
'month_week'
:
export_tb
=
f
"{site_name}_asin_related_30_day"
export_tb
=
f
"{site_name}_asin_related_30_day_copy"
export_tb_target
=
f
"{site_name}_asin_related_30_day"
report_type
=
'30_day'
report_type
=
'30_day'
report_date
=
date
.
today
()
report_date
=
date
.
today
()
else
:
else
:
...
@@ -85,17 +86,27 @@ if __name__ == '__main__':
...
@@ -85,17 +86,27 @@ if __name__ == '__main__':
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
print
(
"数据类型修改完成,准备创建索引!"
)
print
(
"数据类型修改完成,准备创建索引!"
)
sql
=
f
"""
if
date_type
==
'month'
:
CREATE INDEX {export_tb}_asin_idx ON {export_tb} USING btree (
sql
=
f
"""
"asin" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
CREATE INDEX {export_tb}_asin_idx ON {export_tb} USING btree (
);
"asin" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX {export_tb}_related_asin_idx ON {export_tb} USING gin (
CREATE INDEX {export_tb}_related_asin_idx ON {export_tb} USING gin (
"related_asin" COLLATE "pg_catalog"."default" "pg_catalog"."array_ops"
"related_asin" COLLATE "pg_catalog"."default" "pg_catalog"."array_ops"
);
);
"""
"""
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
print
(
"索引创建完成,准备插入流程记录表!"
)
print
(
"索引创建完成,准备插入流程记录表!"
)
elif
date_type
==
'month_week'
:
# 构建索引并交换表名
DBUtil
.
exchange_tb
(
engine
=
engine
,
source_tb_name
=
export_tb
,
target_tb_name
=
export_tb_target
,
cp_index_flag
=
True
)
print
(
"索引创建完成,准备插入流程记录表!"
)
sql
=
f
"""
sql
=
f
"""
REPLACE INTO selection.workflow_everyday
REPLACE INTO selection.workflow_everyday
...
...
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