Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
bad7a392
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bad7a392
编写于
9月 07, 2020
作者:
X
xiaoxiao
提交者:
GitHub
9月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "fix gpload fail when capital letters in column name in merge mode (#10751)"
This reverts commit
4ba11904
.
上级
4ba11904
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
55 deletion
+26
-55
gpMgmt/bin/gpload.py
gpMgmt/bin/gpload.py
+2
-2
gpMgmt/bin/gpload_test/.gitignore
gpMgmt/bin/gpload_test/.gitignore
+0
-1
gpMgmt/bin/gpload_test/gpload2/TEST.py
gpMgmt/bin/gpload_test/gpload2/TEST.py
+6
-16
gpMgmt/bin/gpload_test/gpload2/data/external_file_16.txt
gpMgmt/bin/gpload_test/gpload2/data/external_file_16.txt
+0
-8
gpMgmt/bin/gpload_test/gpload2/query41.ans
gpMgmt/bin/gpload_test/gpload2/query41.ans
+18
-28
未找到文件。
gpMgmt/bin/gpload.py
浏览文件 @
bad7a392
...
@@ -2518,9 +2518,9 @@ class gpload:
...
@@ -2518,9 +2518,9 @@ class gpload:
# MPP-14667 - self.reuse_tables should change one, and only one, aspect of how we build the following table,
# MPP-14667 - self.reuse_tables should change one, and only one, aspect of how we build the following table,
# and that is, whether it's a temp table or not. In other words, is_temp_table = '' iff self.reuse_tables == True.
# and that is, whether it's a temp table or not. In other words, is_temp_table = '' iff self.reuse_tables == True.
sql
=
'CREATE %sTABLE %s '
%
(
is_temp_table
,
self
.
staging_table_name
)
sql
=
'CREATE %sTABLE %s '
%
(
is_temp_table
,
self
.
staging_table_name
)
cols
=
map
(
lambda
a
:
'
"%s"
%s'
%
(
a
[
0
],
a
[
1
]),
target_columns
)
cols
=
map
(
lambda
a
:
'
%s
%s'
%
(
a
[
0
],
a
[
1
]),
target_columns
)
sql
+=
"(%s)"
%
','
.
join
(
cols
)
sql
+=
"(%s)"
%
','
.
join
(
cols
)
#
sql += " DISTRIBUTED BY (%s)" % ', '.join(distcols)
sql
+=
" DISTRIBUTED BY (%s)"
%
', '
.
join
(
distcols
)
self
.
log
(
self
.
LOG
,
sql
)
self
.
log
(
self
.
LOG
,
sql
)
if
not
self
.
options
.
D
:
if
not
self
.
options
.
D
:
...
...
gpMgmt/bin/gpload_test/.gitignore
浏览文件 @
bad7a392
...
@@ -4,7 +4,6 @@ gpload/config
...
@@ -4,7 +4,6 @@ gpload/config
gpload2/config
gpload2/config
gpload2/setup.out
gpload2/setup.out
gpload2/data_file.txt
gpload2/data_file.txt
gpload2/data_file2.txt
GPTest.pm
GPTest.pm
gpstringsubs.pl
gpstringsubs.pl
gpdiff.pl
gpdiff.pl
...
...
gpMgmt/bin/gpload_test/gpload2/TEST.py
浏览文件 @
bad7a392
...
@@ -98,8 +98,8 @@ d = mkpath('config')
...
@@ -98,8 +98,8 @@ d = mkpath('config')
if
not
os
.
path
.
exists
(
d
):
if
not
os
.
path
.
exists
(
d
):
os
.
mkdir
(
d
)
os
.
mkdir
(
d
)
def
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
''
,
columns_flag
=
'0'
,
mapping
=
'0'
,
portNum
=
'8081'
,
database
=
'reuse_gptest'
,
host
=
'localhost'
,
formatOpts
=
'text'
,
file
=
'data/external_file_01.txt'
,
table
=
'texttable'
,
format
=
'text'
,
delimiter
=
"'|'"
,
escape
=
''
,
quote
=
''
,
truncate
=
'False'
,
log_errors
=
None
,
error_limit
=
'0'
,
error_table
=
None
,
externalSchema
=
None
,
staging_table
=
None
,
fast_match
=
'false'
,
encoding
=
None
,
preload
=
True
,
fill
=
False
,
config
=
'config/config_file'
):
def
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
''
,
columns_flag
=
'0'
,
mapping
=
'0'
,
portNum
=
'8081'
,
database
=
'reuse_gptest'
,
host
=
'localhost'
,
formatOpts
=
'text'
,
file
=
'data/external_file_01.txt'
,
table
=
'texttable'
,
format
=
'text'
,
delimiter
=
"'|'"
,
escape
=
''
,
quote
=
''
,
truncate
=
'False'
,
log_errors
=
None
,
error_limit
=
'0'
,
error_table
=
None
,
externalSchema
=
None
,
staging_table
=
None
,
fast_match
=
'false'
,
encoding
=
None
,
preload
=
True
,
fill
=
False
,
config
=
'config/config_file'
,
match_columns
=
'true'
,
update_columns
=
'n2'
):
f
=
open
(
mkpath
(
config
),
'w'
)
f
=
open
(
mkpath
(
config
),
'w'
)
f
.
write
(
"VERSION: 1.0.0.1"
)
f
.
write
(
"VERSION: 1.0.0.1"
)
if
database
:
if
database
:
...
@@ -164,16 +164,11 @@ def write_config_file(mode='insert', reuse_flag='',columns_flag='0',mapping='0',
...
@@ -164,16 +164,11 @@ def write_config_file(mode='insert', reuse_flag='',columns_flag='0',mapping='0',
if
mode
==
'merge'
:
if
mode
==
'merge'
:
f
.
write
(
"
\n
- MODE: "
+
'merge'
)
f
.
write
(
"
\n
- MODE: "
+
'merge'
)
f
.
write
(
"
\n
- UPDATE_COLUMNS:"
)
f
.
write
(
"
\n
- UPDATE_COLUMNS:"
)
f
.
write
(
"
\n
- "
+
update_columns
)
f
.
write
(
"
\n
- n2"
)
if
match_columns
==
'true'
:
f
.
write
(
"
\n
- MATCH_COLUMNS:"
)
f
.
write
(
"
\n
- MATCH_COLUMNS:"
)
f
.
write
(
"
\n
- n1"
)
f
.
write
(
"
\n
- n1"
)
f
.
write
(
"
\n
- s1"
)
f
.
write
(
"
\n
- s1"
)
f
.
write
(
"
\n
- s2"
)
f
.
write
(
"
\n
- s2"
)
if
match_columns
==
'2'
:
f
.
write
(
"
\n
- MATCH_COLUMNS:"
)
f
.
write
(
"
\n
- '
\"
Field1
\"
'"
)
f
.
write
(
"
\n
- '
\"
Field#2
\"
'"
)
if
mapping
==
'1'
:
if
mapping
==
'1'
:
f
.
write
(
"
\n
- MAPPING:"
)
f
.
write
(
"
\n
- MAPPING:"
)
f
.
write
(
"
\n
s1: s_s1"
)
f
.
write
(
"
\n
s1: s_s1"
)
...
@@ -805,11 +800,6 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
...
@@ -805,11 +800,6 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
runfile
(
file
)
runfile
(
file
)
copy_data
(
'external_file_15.txt'
,
'data_file.txt'
)
copy_data
(
'external_file_15.txt'
,
'data_file.txt'
)
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file.txt'
,
table
=
'testSpecialChar'
,
columns_flag
=
'2'
,
delimiter
=
";"
)
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file.txt'
,
table
=
'testSpecialChar'
,
columns_flag
=
'2'
,
delimiter
=
";"
)
copy_data
(
'external_file_16.txt'
,
'data_file2.txt'
)
write_config_file
(
update_columns
=
'
\'
"Field#2"
\'
'
,
config
=
'config/config_file2'
,
mode
=
'merge'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file2.txt'
,
table
=
'testSpecialChar'
,
columns_flag
=
'2'
,
delimiter
=
";"
,
match_columns
=
'2'
)
f
=
open
(
mkpath
(
'query41.sql'
),
'a'
)
f
.
write
(
"\! gpload -f "
+
mkpath
(
'config/config_file2'
)
+
" -d reuse_gptest
\n
"
)
f
.
close
()
self
.
doTest
(
41
)
self
.
doTest
(
41
)
...
...
gpMgmt/bin/gpload_test/gpload2/data/external_file_16.txt
已删除
100644 → 0
浏览文件 @
4ba11904
1;Line 1
2;2nd line
3;test
4;
5;Vide
6;Field 2
8;new line
9;Line 10
\ No newline at end of file
gpMgmt/bin/gpload_test/gpload2/query41.ans
浏览文件 @
bad7a392
2020-09-01 11:10:22|INFO|gpload session started 2020-09-01 11:10:22
2020-08-20 16:13:06|INFO|gpload session started 2020-08-20 16:13:06
2020-09-01 11:10:22|INFO|setting schema 'public' for table 'testspecialchar'
2020-08-20 16:13:06|INFO|setting schema 'public' for table 'testspecialchar'
2020-09-01 11:10:22|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-08-20 16:13:06|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-09-01 11:10:22|INFO|did not find an external table to reuse. creating ext_gpload_reusable_ac968900_ec00_11ea_9fbd_00505698707d
2020-08-20 16:13:06|INFO|did not find an external table to reuse. creating ext_gpload_reusable_f9d2769a_e2bc_11ea_9270_00505698707d
2020-09-01 11:10:22|INFO|running time: 0.08 seconds
2020-08-20 16:13:06|INFO|running time: 0.08 seconds
2020-09-01 11:10:22|INFO|rows Inserted = 8
2020-08-20 16:13:06|INFO|rows Inserted = 8
2020-09-01 11:10:22|INFO|rows Updated = 0
2020-08-20 16:13:06|INFO|rows Updated = 0
2020-09-01 11:10:22|INFO|data formatting errors = 0
2020-08-20 16:13:06|INFO|data formatting errors = 0
2020-09-01 11:10:22|INFO|gpload succeeded
2020-08-20 16:13:06|INFO|gpload succeeded
2020-09-01 11:10:23|INFO|gpload session started 2020-09-01 11:10:23
2020-08-20 16:13:06|INFO|gpload session started 2020-08-20 16:13:06
2020-09-01 11:10:23|INFO|setting schema 'public' for table 'testspecialchar'
2020-08-20 16:13:06|INFO|setting schema 'public' for table 'testspecialchar'
2020-09-01 11:10:23|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-08-20 16:13:06|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-09-01 11:10:23|INFO|reusing external table ext_gpload_reusable_ac968900_ec00_11ea_9fbd_00505698707d
2020-08-20 16:13:06|INFO|reusing external table ext_gpload_reusable_f9d2769a_e2bc_11ea_9270_00505698707d
2020-09-01 11:10:23|INFO|running time: 0.06 seconds
2020-08-20 16:13:06|INFO|running time: 0.07 seconds
2020-09-01 11:10:23|INFO|rows Inserted = 8
2020-08-20 16:13:06|INFO|rows Inserted = 8
2020-09-01 11:10:23|INFO|rows Updated = 0
2020-08-20 16:13:06|INFO|rows Updated = 0
2020-09-01 11:10:23|INFO|data formatting errors = 0
2020-08-20 16:13:06|INFO|data formatting errors = 0
2020-09-01 11:10:23|INFO|gpload succeeded
2020-08-20 16:13:06|INFO|gpload succeeded
2020-09-01 11:10:23|INFO|gpload session started 2020-09-01 11:10:23
2020-09-01 11:10:23|INFO|setting schema 'public' for table 'testspecialchar'
2020-09-01 11:10:23|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file2.txt" -t 30
2020-09-01 11:10:23|INFO|did not find a staging table to reuse. creating staging_gpload_reusable_a1101b5024707ea34f55e778f329e548
2020-09-01 11:10:23|INFO|did not find an external table to reuse. creating ext_gpload_reusable_ace96f80_ec00_11ea_bd1e_00505698707d
2020-09-01 11:10:23|INFO|running time: 0.10 seconds
2020-09-01 11:10:23|INFO|rows Inserted = 2
2020-09-01 11:10:23|INFO|rows Updated = 12
2020-09-01 11:10:23|INFO|data formatting errors = 0
2020-09-01 11:10:23|INFO|gpload succeeded
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录