Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4dfee0f3
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,体验更适合开发者的 AI 搜索 >>
提交
4dfee0f3
编写于
8月 17, 2020
作者:
H
Huiliang.Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add merge mode with multiple pk test case
上级
182d27e8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
145 addition
and
3 deletion
+145
-3
gpMgmt/bin/gpload_test/gpload2/TEST.py
gpMgmt/bin/gpload_test/gpload2/TEST.py
+18
-3
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk.txt
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk.txt
+4
-0
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk2.txt
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk2.txt
+5
-0
gpMgmt/bin/gpload_test/gpload2/query39.ans
gpMgmt/bin/gpload_test/gpload2/query39.ans
+30
-0
gpMgmt/bin/gpload_test/gpload2/setup.ans
gpMgmt/bin/gpload_test/gpload2/setup.ans
+77
-0
gpMgmt/bin/gpload_test/gpload2/setup.sql
gpMgmt/bin/gpload_test/gpload2/setup.sql
+11
-0
未找到文件。
gpMgmt/bin/gpload_test/gpload2/TEST.py
浏览文件 @
4dfee0f3
...
@@ -98,9 +98,9 @@ d = mkpath('config')
...
@@ -98,9 +98,9 @@ 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
):
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
,
config
=
'config/config_file'
):
f
=
open
(
mkpath
(
'config/config_file'
),
'w'
)
f
=
open
(
mkpath
(
config
),
'w'
)
f
.
write
(
"VERSION: 1.0.0.1"
)
f
.
write
(
"VERSION: 1.0.0.1"
)
if
database
:
if
database
:
f
.
write
(
"
\n
DATABASE: "
+
database
)
f
.
write
(
"
\n
DATABASE: "
+
database
)
...
@@ -443,7 +443,7 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
...
@@ -443,7 +443,7 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
def
test_00_gpload_formatOpts_setup
(
self
):
def
test_00_gpload_formatOpts_setup
(
self
):
"0 gpload setup"
"0 gpload setup"
for
num
in
range
(
1
,
39
):
for
num
in
range
(
1
,
40
):
f
=
open
(
mkpath
(
'query%d.sql'
%
num
),
'w'
)
f
=
open
(
mkpath
(
'query%d.sql'
%
num
),
'w'
)
f
.
write
(
"\! gpload -f "
+
mkpath
(
'config/config_file'
)
+
" -d reuse_gptest
\n
"
+
"\! gpload -f "
+
mkpath
(
'config/config_file'
)
+
" -d reuse_gptest
\n
"
)
f
.
write
(
"\! gpload -f "
+
mkpath
(
'config/config_file'
)
+
" -d reuse_gptest
\n
"
+
"\! gpload -f "
+
mkpath
(
'config/config_file'
)
+
" -d reuse_gptest
\n
"
)
f
.
close
()
f
.
close
()
...
@@ -753,6 +753,21 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
...
@@ -753,6 +753,21 @@ class GPLoad_FormatOpts_TestCase(unittest.TestCase):
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file.txt'
,
error_table
=
"err_table"
,
error_limit
=
'1000'
,
preload
=
False
)
write_config_file
(
mode
=
'insert'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file.txt'
,
error_table
=
"err_table"
,
error_limit
=
'1000'
,
preload
=
False
)
self
.
doTest
(
38
)
self
.
doTest
(
38
)
def
test_39_gpload_merge_mode_with_multi_pk
(
self
):
"39 gpload merge mode with multiple pk"
file
=
mkpath
(
'setup.sql'
)
runfile
(
file
)
copy_data
(
'external_file_pk.txt'
,
'data_file.txt'
)
write_config_file
(
mode
=
'merge'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file.txt'
,
table
=
'testpk'
)
copy_data
(
'external_file_pk2.txt'
,
'data_file2.txt'
)
write_config_file
(
mode
=
'merge'
,
reuse_flag
=
'true'
,
fast_match
=
'false'
,
file
=
'data_file2.txt'
,
table
=
'testpk'
,
config
=
'config/config_file2'
)
f
=
open
(
mkpath
(
'query39.sql'
),
'a'
)
f
.
write
(
"\! gpload -f "
+
mkpath
(
'config/config_file2'
)
+
" -d reuse_gptest
\n
"
)
f
.
close
()
self
.
doTest
(
39
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
suite
=
unittest
.
TestLoader
().
loadTestsFromTestCase
(
GPLoad_FormatOpts_TestCase
)
suite
=
unittest
.
TestLoader
().
loadTestsFromTestCase
(
GPLoad_FormatOpts_TestCase
)
runner
=
unittest
.
TextTestRunner
(
verbosity
=
2
)
runner
=
unittest
.
TextTestRunner
(
verbosity
=
2
)
...
...
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk.txt
0 → 100644
浏览文件 @
4dfee0f3
1|1|usa|1
2|2|usa|2
3|2|asia|3
4|2|usa|4
gpMgmt/bin/gpload_test/gpload2/data/external_file_pk2.txt
0 → 100644
浏览文件 @
4dfee0f3
1|1|usa|1
2|2|usa|2
3|2|asia|56
4|2|usa|4
5|12|asia|5
gpMgmt/bin/gpload_test/gpload2/query39.ans
0 → 100644
浏览文件 @
4dfee0f3
2020-08-17 16:12:26|INFO|gpload session started 2020-08-17 16:12:26
2020-08-17 16:12:26|INFO|setting schema 'public' for table 'testpk'
2020-08-17 16:12:26|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-08-17 16:12:26|INFO|did not find a staging table to reuse. creating staging_gpload_reusable_9cfc886e8f484d05619f4e7cb992ce20
2020-08-17 16:12:26|INFO|did not find an external table to reuse. creating ext_gpload_reusable_62d0fa4e_e061_11ea_aee0_00505698d059
2020-08-17 16:12:26|INFO|running time: 0.12 seconds
2020-08-17 16:12:26|INFO|rows Inserted = 4
2020-08-17 16:12:26|INFO|rows Updated = 0
2020-08-17 16:12:26|INFO|data formatting errors = 0
2020-08-17 16:12:26|INFO|gpload succeeded
2020-08-17 16:12:26|INFO|gpload session started 2020-08-17 16:12:26
2020-08-17 16:12:26|INFO|setting schema 'public' for table 'testpk'
2020-08-17 16:12:26|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file.txt" -t 30
2020-08-17 16:12:26|INFO|reusing staging table staging_gpload_reusable_9cfc886e8f484d05619f4e7cb992ce20
2020-08-17 16:12:26|INFO|reusing external table ext_gpload_reusable_62d0fa4e_e061_11ea_aee0_00505698d059
2020-08-17 16:12:26|INFO|running time: 0.11 seconds
2020-08-17 16:12:26|INFO|rows Inserted = 0
2020-08-17 16:12:26|INFO|rows Updated = 4
2020-08-17 16:12:26|INFO|data formatting errors = 0
2020-08-17 16:12:26|INFO|gpload succeeded
2020-08-17 16:12:26|INFO|gpload session started 2020-08-17 16:12:26
2020-08-17 16:12:26|INFO|setting schema 'public' for table 'testpk'
2020-08-17 16:12:26|INFO|started gpfdist -p 8081 -P 8082 -f "/home/gpadmin/workspace/gpdb/gpMgmt/bin/gpload_test/gpload2/data_file2.txt" -t 30
2020-08-17 16:12:26|INFO|reusing staging table staging_gpload_reusable_9cfc886e8f484d05619f4e7cb992ce20
2020-08-17 16:12:26|INFO|did not find an external table to reuse. creating ext_gpload_reusable_631ae46a_e061_11ea_993b_00505698d059
2020-08-17 16:12:26|INFO|running time: 0.16 seconds
2020-08-17 16:12:26|INFO|rows Inserted = 1
2020-08-17 16:12:26|INFO|rows Updated = 4
2020-08-17 16:12:26|INFO|data formatting errors = 0
2020-08-17 16:12:26|INFO|gpload succeeded
gpMgmt/bin/gpload_test/gpload2/setup.ans
浏览文件 @
4dfee0f3
...
@@ -26,3 +26,80 @@ CREATE TABLE test.csvtable (
...
@@ -26,3 +26,80 @@ CREATE TABLE test.csvtable (
year int, make text, model text, decription text, price decimal)
year int, make text, model text, decription text, price decimal)
DISTRIBUTED BY (year);
DISTRIBUTED BY (year);
CREATE TABLE
CREATE TABLE
create table testpk (n1 integer, s1 integer, s2 varchar(128), n2 integer, primary key(n1,s1,s2))
partition by range (s1)
subpartition by list(s2)
SUBPARTITION TEMPLATE
( SUBPARTITION usa VALUES ('usa'),
SUBPARTITION asia VALUES ('asia'),
SUBPARTITION europe VALUES ('europe'),
DEFAULT SUBPARTITION other_regions)
(start (1) end (13) every (1),
default partition others)
;
NOTICE: CREATE TABLE will create partition "testpk_1_prt_others" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_others_2_prt_usa" for table "testpk_1_prt_others"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_others_2_prt_asia" for table "testpk_1_prt_others"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_others_2_prt_europe" for table "testpk_1_prt_others"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_others_2_prt_other_regions" for table "testpk_1_prt_others"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_2" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_2_2_prt_usa" for table "testpk_1_prt_2"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_2_2_prt_asia" for table "testpk_1_prt_2"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_2_2_prt_europe" for table "testpk_1_prt_2"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_2_2_prt_other_regions" for table "testpk_1_prt_2"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_3" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_3_2_prt_usa" for table "testpk_1_prt_3"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_3_2_prt_asia" for table "testpk_1_prt_3"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_3_2_prt_europe" for table "testpk_1_prt_3"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_3_2_prt_other_regions" for table "testpk_1_prt_3"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_4" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_4_2_prt_usa" for table "testpk_1_prt_4"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_4_2_prt_asia" for table "testpk_1_prt_4"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_4_2_prt_europe" for table "testpk_1_prt_4"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_4_2_prt_other_regions" for table "testpk_1_prt_4"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_5" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_5_2_prt_usa" for table "testpk_1_prt_5"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_5_2_prt_asia" for table "testpk_1_prt_5"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_5_2_prt_europe" for table "testpk_1_prt_5"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_5_2_prt_other_regions" for table "testpk_1_prt_5"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_6" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_6_2_prt_usa" for table "testpk_1_prt_6"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_6_2_prt_asia" for table "testpk_1_prt_6"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_6_2_prt_europe" for table "testpk_1_prt_6"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_6_2_prt_other_regions" for table "testpk_1_prt_6"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_7" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_7_2_prt_usa" for table "testpk_1_prt_7"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_7_2_prt_asia" for table "testpk_1_prt_7"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_7_2_prt_europe" for table "testpk_1_prt_7"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_7_2_prt_other_regions" for table "testpk_1_prt_7"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_8" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_8_2_prt_usa" for table "testpk_1_prt_8"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_8_2_prt_asia" for table "testpk_1_prt_8"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_8_2_prt_europe" for table "testpk_1_prt_8"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_8_2_prt_other_regions" for table "testpk_1_prt_8"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_9" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_9_2_prt_usa" for table "testpk_1_prt_9"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_9_2_prt_asia" for table "testpk_1_prt_9"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_9_2_prt_europe" for table "testpk_1_prt_9"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_9_2_prt_other_regions" for table "testpk_1_prt_9"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_10" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_10_2_prt_usa" for table "testpk_1_prt_10"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_10_2_prt_asia" for table "testpk_1_prt_10"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_10_2_prt_europe" for table "testpk_1_prt_10"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_10_2_prt_other_regions" for table "testpk_1_prt_10"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_11" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_11_2_prt_usa" for table "testpk_1_prt_11"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_11_2_prt_asia" for table "testpk_1_prt_11"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_11_2_prt_europe" for table "testpk_1_prt_11"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_11_2_prt_other_regions" for table "testpk_1_prt_11"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_12" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_12_2_prt_usa" for table "testpk_1_prt_12"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_12_2_prt_asia" for table "testpk_1_prt_12"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_12_2_prt_europe" for table "testpk_1_prt_12"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_12_2_prt_other_regions" for table "testpk_1_prt_12"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_13" for table "testpk"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_13_2_prt_usa" for table "testpk_1_prt_13"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_13_2_prt_asia" for table "testpk_1_prt_13"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_13_2_prt_europe" for table "testpk_1_prt_13"
NOTICE: CREATE TABLE will create partition "testpk_1_prt_13_2_prt_other_regions" for table "testpk_1_prt_13"
CREATE TABLE
gpMgmt/bin/gpload_test/gpload2/setup.sql
浏览文件 @
4dfee0f3
...
@@ -19,3 +19,14 @@ CREATE TABLE csvtable (
...
@@ -19,3 +19,14 @@ CREATE TABLE csvtable (
CREATE
TABLE
test
.
csvtable
(
CREATE
TABLE
test
.
csvtable
(
year
int
,
make
text
,
model
text
,
decription
text
,
price
decimal
)
year
int
,
make
text
,
model
text
,
decription
text
,
price
decimal
)
DISTRIBUTED
BY
(
year
);
DISTRIBUTED
BY
(
year
);
create
table
testpk
(
n1
integer
,
s1
integer
,
s2
varchar
(
128
),
n2
integer
,
primary
key
(
n1
,
s1
,
s2
))
partition
by
range
(
s1
)
subpartition
by
list
(
s2
)
SUBPARTITION
TEMPLATE
(
SUBPARTITION
usa
VALUES
(
'usa'
),
SUBPARTITION
asia
VALUES
(
'asia'
),
SUBPARTITION
europe
VALUES
(
'europe'
),
DEFAULT
SUBPARTITION
other_regions
)
(
start
(
1
)
end
(
13
)
every
(
1
),
default
partition
others
)
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录