提交 a33c0f2e 编写于 作者: D Daniel Gustafsson

Remove ao_create_alter_valid_table test suite

This test suite was mostly testing unsupported append-only table
functionality which has since long been implemented, but since the
tests were wrapped in ignore blocks it wasn't even testing that.

All the tests in this suite are covered by other suite which are
better maintained so remove to shave a few cycles off ICW time
(no wallclock time improvement of ICW is expected since it was
running in a parallel group).

Discussion: https://groups.google.com/a/greenplum.org/forum/#!topic/gpdb-dev/mxld3WyhPZ8Reviewed-by: NHeikki Linnakangas <hlinnakangas@pivotal.io>
Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
上级 3a9c9652
--Tables with storage Parameters
CREATE TABLE table_storage_parameters (
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric
) WITH ( APPENDONLY=TRUE , COMPRESSLEVEL= 5 , FILLFACTOR= 50) DISTRIBUTED RANDOMLY;
-- create a table and load some data
create table aocomptest (a int, b int, c int, d int) WITH (appendonly=true,compresslevel=3);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
-- start_ignore
\d aocomptest
Append-Only Table "public.aocomptest"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
b | integer |
c | integer |
d | integer |
Compression Type: zlib
Compression Level: 3
Block Size: 32768
Checksum: t
Distributed by: (a)
-- end_ignore
insert into aocomptest select i, i%1, i%2, i%3 from generate_series(1,100)i;
-- vacuum analyze the table
vacuum analyze aocomptest;
-- rename the table
alter table aocomptest rename to new_test;
-- start_ignore
\d new_test
Append-Only Table "public.new_test"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
b | integer |
c | integer |
d | integer |
Compression Type: zlib
Compression Level: 3
Block Size: 32768
Checksum: t
Distributed by: (a)
-- end_ignore
alter table new_test rename to aocomptest;
-- start_ignore
\d aocomptest
Append-Only Table "public.aocomptest"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
b | integer |
c | integer |
d | integer |
Compression Type: zlib
Compression Level: 3
Block Size: 32768
Checksum: t
Distributed by: (a)
-- end_ignore
-- Negative Tests for AO Tables
create table foo_ao (a int) with (appendonly=true);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
create table bar_ao (a int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
--invalid operations
-- start_ignore
delete from foo_ao;
-- end_ignore
-- try and trick by setting rules
create rule one as on insert to bar_ao do instead update foo_ao set a=1;
create rule two as on insert to bar_ao do instead delete from foo_ao where a=1;
-- create table with ao specification should fail
-- start_ignore
create table mpp2865_ao_syntax_test (a int, b int) with (compresslevel=5);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
ERROR: invalid option 'compresslevel' for base relation. Only valid for Append Only relations
create table mpp2865_ao_syntax_test (a int, b int) with (blocksize=8192);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
ERROR: invalid option 'blocksize' for base relation. Only valid for Append Only relations
create table mpp2865_ao_sytax_text(a int, b int) with (appendonly=false,blocksize=8192);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
ERROR: invalid option 'blocksize' for base relation. Only valid for Append Only relations
-- end_ignore
-- AO tables with partitions
create table ggg_mpp2847 (a char(1), b char(2), d char(3)) with (appendonly=true)
distributed by (a)
partition by LIST (b)
(
partition aa values ('a', 'b', 'c', 'd'),
partition bb values ('e', 'f', 'g')
);
NOTICE: CREATE TABLE will create partition "ggg_mpp2847_1_prt_aa" for table "ggg_mpp2847"
NOTICE: CREATE TABLE will create partition "ggg_mpp2847_1_prt_bb" for table "ggg_mpp2847"
insert into ggg_mpp2847 values ('x', 'a');
insert into ggg_mpp2847 values ('x', 'b');
insert into ggg_mpp2847 values ('x', 'c');
insert into ggg_mpp2847 values ('x', 'd');
insert into ggg_mpp2847 values ('x', 'e');
insert into ggg_mpp2847 values ('x', 'f');
insert into ggg_mpp2847 values ('x', 'g');
insert into ggg_mpp2847 values ('x', 'a');
insert into ggg_mpp2847 values ('x', 'b');
insert into ggg_mpp2847 values ('x', 'c');
insert into ggg_mpp2847 values ('x', 'd');
insert into ggg_mpp2847 values ('x', 'e');
insert into ggg_mpp2847 values ('x', 'f');
insert into ggg_mpp2847 values ('x', 'g');
select * from ggg_mpp2847;
a | b | d
---+----+---
x | a |
x | b |
x | c |
x | d |
x | a |
x | b |
x | c |
x | d |
x | e |
x | f |
x | g |
x | e |
x | f |
x | g |
(14 rows)
-- drop table ggg_mpp2847;
-- AO check correct syntax
create table ao_syntax_test(a int, b int) WITH (appendonly=true);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=false);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=false}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=8192);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=8192}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=16384);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=16384}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=24576);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=24576}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=32768);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=32768}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=40960);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=40960}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=49152);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
select case when reloptions='{appendonly=true,blocksize=49152}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
case
---------
Success
(1 row)
......@@ -103,7 +103,7 @@ test: db_size_functions
ignore: gp_portal_error
test: external_table external_table_create_privs column_compression eagerfree alter_table_aocs alter_table_aocs2 alter_distribution_policy aoco_privileges aocs
test: alter_table_set alter_table_gp alter_table_ao ao_create_alter_valid_table subtransaction_visibility oid_consistency udf_exception_blocks
test: alter_table_set alter_table_gp alter_table_ao subtransaction_visibility oid_consistency udf_exception_blocks
test: ic
test: resource_queue
......
--Tables with storage Parameters
CREATE TABLE table_storage_parameters (
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric
) WITH ( APPENDONLY=TRUE , COMPRESSLEVEL= 5 , FILLFACTOR= 50) DISTRIBUTED RANDOMLY;
-- create a table and load some data
create table aocomptest (a int, b int, c int, d int) WITH (appendonly=true,compresslevel=3);
-- start_ignore
\d aocomptest
-- end_ignore
insert into aocomptest select i, i%1, i%2, i%3 from generate_series(1,100)i;
-- vacuum analyze the table
vacuum analyze aocomptest;
-- rename the table
alter table aocomptest rename to new_test;
-- start_ignore
\d new_test
-- end_ignore
alter table new_test rename to aocomptest;
-- start_ignore
\d aocomptest
-- end_ignore
-- Negative Tests for AO Tables
create table foo_ao (a int) with (appendonly=true);
create table bar_ao (a int);
--invalid operations
-- start_ignore
delete from foo_ao;
-- end_ignore
-- try and trick by setting rules
create rule one as on insert to bar_ao do instead update foo_ao set a=1;
create rule two as on insert to bar_ao do instead delete from foo_ao where a=1;
-- create table with ao specification should fail
-- start_ignore
create table mpp2865_ao_syntax_test (a int, b int) with (compresslevel=5);
create table mpp2865_ao_syntax_test (a int, b int) with (blocksize=8192);
create table mpp2865_ao_sytax_text(a int, b int) with (appendonly=false,blocksize=8192);
-- end_ignore
-- AO tables with partitions
create table ggg_mpp2847 (a char(1), b char(2), d char(3)) with (appendonly=true)
distributed by (a)
partition by LIST (b)
(
partition aa values ('a', 'b', 'c', 'd'),
partition bb values ('e', 'f', 'g')
);
insert into ggg_mpp2847 values ('x', 'a');
insert into ggg_mpp2847 values ('x', 'b');
insert into ggg_mpp2847 values ('x', 'c');
insert into ggg_mpp2847 values ('x', 'd');
insert into ggg_mpp2847 values ('x', 'e');
insert into ggg_mpp2847 values ('x', 'f');
insert into ggg_mpp2847 values ('x', 'g');
insert into ggg_mpp2847 values ('x', 'a');
insert into ggg_mpp2847 values ('x', 'b');
insert into ggg_mpp2847 values ('x', 'c');
insert into ggg_mpp2847 values ('x', 'd');
insert into ggg_mpp2847 values ('x', 'e');
insert into ggg_mpp2847 values ('x', 'f');
insert into ggg_mpp2847 values ('x', 'g');
select * from ggg_mpp2847;
-- drop table ggg_mpp2847;
-- AO check correct syntax
create table ao_syntax_test(a int, b int) WITH (appendonly=true);
select case when reloptions='{appendonly=true}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=false);
select case when reloptions='{appendonly=false}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=8192);
select case when reloptions='{appendonly=true,blocksize=8192}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=16384);
select case when reloptions='{appendonly=true,blocksize=16384}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=24576);
select case when reloptions='{appendonly=true,blocksize=24576}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=32768);
select case when reloptions='{appendonly=true,blocksize=32768}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=40960);
select case when reloptions='{appendonly=true,blocksize=40960}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
drop table if exists ao_syntax_test;
create table ao_syntax_test(a int, b int) WITH (appendonly=true,blocksize=49152);
select case when reloptions='{appendonly=true,blocksize=49152}' then 'Success' else 'Failure' end from pg_class where relname='ao_syntax_test';
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册