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
99b454aa
Commit
99b454aa
authored
Jul 30, 2026
by
hejiangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复ods_st_key索引创建
parent
a7e6d6ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
ods_st_key.py
Pyspark_job/sqoop_export/ods_st_key.py
+6
-2
No files found.
Pyspark_job/sqoop_export/ods_st_key.py
View file @
99b454aa
...
@@ -52,15 +52,19 @@ if __name__ == '__main__':
...
@@ -52,15 +52,19 @@ if __name__ == '__main__':
SSHUtil
.
exec_command_async
(
client
,
sh
,
ignore_err
=
False
)
SSHUtil
.
exec_command_async
(
client
,
sh
,
ignore_err
=
False
)
client
.
close
()
client
.
close
()
#
创建索引,交换表名
#
填充 tsvector 列,手动创建全部索引(不依赖 cp_index_flag 从老表拷贝,避免索引累积)
sql
=
f
"""
sql
=
f
"""
update {export_tb} set keyword_tsv = to_tsvector('english_amazonword', search_term);
update {export_tb} set keyword_tsv = to_tsvector('english_amazonword', search_term);
CREATE INDEX ON {export_tb} (st_key);
CREATE INDEX ON {export_tb} (search_term);
CREATE INDEX ON {export_tb} USING gin (keyword_tsv);
"""
"""
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
DBUtil
.
engine_exec_sql
(
engine
,
sql
)
DBUtil
.
exchange_tb
(
DBUtil
.
exchange_tb
(
engine
=
engine
,
engine
=
engine
,
source_tb_name
=
export_tb
,
source_tb_name
=
export_tb
,
target_tb_name
=
export_tb_target
,
target_tb_name
=
export_tb_target
,
cp_index_flag
=
Tru
e
cp_index_flag
=
Fals
e
)
)
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