提交 42b33d42 编写于 作者: D Daniel Gustafsson

Migrate BugBuster mpph tests to ICW

This combines the various mpph tests in BugBuster into a single
new ICW suite, bb_mpph. Most of the existing queries were moved
over with a few pruned that were too uninteresting, or covered
elsewhere.

The BugBuster tests combined are: load_mpph, mpph_query,
mpph_aopart, hashagg and opperf.
上级 ab4398dd
--Generate
drop database if exists mpph_heap;
create database mpph_heap;
\c mpph_heap
CREATE TABLE customer (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL,
l_partkey integer NOT NULL,
l_suppkey integer NOT NULL,
l_linenumber integer NOT NULL,
l_quantity numeric(15,2) NOT NULL,
l_extendedprice numeric(15,2) NOT NULL,
l_discount numeric(15,2) NOT NULL,
l_tax numeric(15,2) NOT NULL,
l_returnflag character(1) NOT NULL,
l_linestatus character(1) NOT NULL,
l_shipdate date NOT NULL,
l_commitdate date NOT NULL,
l_receiptdate date NOT NULL,
l_shipinstruct character(25) NOT NULL,
l_shipmode character(10) NOT NULL,
l_comment character varying(44) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer,
n_name character(25),
n_regionkey integer,
n_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL,
o_custkey integer NOT NULL,
o_orderstatus character(1) NOT NULL,
o_totalprice numeric(15,2) NOT NULL,
o_orderdate date NOT NULL,
o_orderpriority character(15) NOT NULL,
o_clerk character(15) NOT NULL,
o_shippriority integer NOT NULL,
o_comment character varying(79) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL,
p_name character varying(55) NOT NULL,
p_mfgr character(25) NOT NULL,
p_brand character(10) NOT NULL,
p_type character varying(25) NOT NULL,
p_size integer NOT NULL,
p_container character(10) NOT NULL,
p_retailprice numeric(15,2) NOT NULL,
p_comment character varying(23) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL,
ps_suppkey integer NOT NULL,
ps_availqty integer NOT NULL,
ps_supplycost numeric(15,2) NOT NULL,
ps_comment character varying(199) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL,
r_name character(25) NOT NULL,
r_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL,
s_name character(25) NOT NULL,
s_address character varying(40) NOT NULL,
s_nationkey integer NOT NULL,
s_phone character(15) NOT NULL,
s_acctbal numeric(15,2) NOT NULL,
s_comment character varying(101) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT)from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
drop database if exists mpph_ao;
create database mpph_ao;
\c mpph_ao
CREATE TABLE customer (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL,
l_partkey integer NOT NULL,
l_suppkey integer NOT NULL,
l_linenumber integer NOT NULL,
l_quantity numeric(15,2) NOT NULL,
l_extendedprice numeric(15,2) NOT NULL,
l_discount numeric(15,2) NOT NULL,
l_tax numeric(15,2) NOT NULL,
l_returnflag character(1) NOT NULL,
l_linestatus character(1) NOT NULL,
l_shipdate date NOT NULL,
l_commitdate date NOT NULL,
l_receiptdate date NOT NULL,
l_shipinstruct character(25) NOT NULL,
l_shipmode character(10) NOT NULL,
l_comment character varying(44) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer,
n_name character(25),
n_regionkey integer,
n_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL,
o_custkey integer NOT NULL,
o_orderstatus character(1) NOT NULL,
o_totalprice numeric(15,2) NOT NULL,
o_orderdate date NOT NULL,
o_orderpriority character(15) NOT NULL,
o_clerk character(15) NOT NULL,
o_shippriority integer NOT NULL,
o_comment character varying(79) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL,
p_name character varying(55) NOT NULL,
p_mfgr character(25) NOT NULL,
p_brand character(10) NOT NULL,
p_type character varying(25) NOT NULL,
p_size integer NOT NULL,
p_container character(10) NOT NULL,
p_retailprice numeric(15,2) NOT NULL,
p_comment character varying(23) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL,
ps_suppkey integer NOT NULL,
ps_availqty integer NOT NULL,
ps_supplycost numeric(15,2) NOT NULL,
ps_comment character varying(199) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL,
r_name character(25) NOT NULL,
r_comment character varying(152)
)
WITH (appendonly=true) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL,
s_name character(25) NOT NULL,
s_address character varying(40) NOT NULL,
s_nationkey integer NOT NULL,
s_phone character(15) NOT NULL,
s_acctbal numeric(15,2) NOT NULL,
s_comment character varying(101) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT)from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
drop database if exists mpph_co;
create database mpph_co;
\c mpph_co
CREATE TABLE customer (
c_custkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_name character varying(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_address character varying(40) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_nationkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_phone character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_acctbal numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_mktsegment character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_comment character varying(117) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_linenumber integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_quantity numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_extendedprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_discount numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_tax numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_returnflag character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_linestatus character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_commitdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_receiptdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipinstruct character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipmode character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_comment character varying(44) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_name character(25) ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_regionkey integer ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_comment character varying(152) ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_custkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderstatus character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_totalprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderpriority character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_clerk character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_shippriority integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_comment character varying(79) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_name character varying(55) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_mfgr character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_brand character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_type character varying(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_size integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_container character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_retailprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_comment character varying(23) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_availqty integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_supplycost numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_comment character varying(199) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
r_name character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
r_comment character varying(152) ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_name character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_address character varying(40) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_nationkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_phone character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_acctbal numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_comment character varying(101) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT) from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
......@@ -2,12 +2,8 @@
## TODO: list test sequence and test dependencies.
##
ignore: jdbc
test: load_mpph
# these tests depend on load_mpph
test: mpph_query mpph_aopart hashagg
ignore: failover
#mpp23872: Disabling gpcheckmirrorseg as it is erroring out bugbuster on some platforms.
ignore: gpcheckmirrorseg
test: memory_quota
test: opperf
# end of tests
\c mpph_heap
set enable_groupagg=off;
set enable_hashagg=on;
select c_nationkey, count(*) from customer group by c_nationkey;
set enable_groupagg=off;
set enable_hashagg=on;
select c_nationkey, sum(c_acctbal) from customer group by c_nationkey;
set enable_groupagg=off;
set enable_hashagg=on;
select c_mktsegment, bool_and(c_nationkey>10) from customer group by c_mktsegment;
set enable_groupagg=off;
set enable_hashagg=on;
select l_returnflag, l_linestatus, variance(l_discount) from lineitem group by l_returnflag, l_linestatus;
set statement_mem= 10240;
set enable_groupagg=off;
set enable_hashagg=on;
select l_orderkey, l_suppkey, var_pop(l_discount) as var_pop from lineitem group by l_orderkey, l_suppkey order by l_orderkey, l_suppkey, var_pop limit 2000;
set enable_groupagg=off;
set enable_hashagg=on;
select l_suppkey, avg(l_discount) from lineitem group by l_suppkey;
set statement_mem= 7000;
set enable_groupagg=off;
set enable_hashagg=on;
select l_orderkey, covar_pop(l_partkey, l_suppkey) as covar_pop from lineitem group by l_orderkey order by l_orderkey, covar_pop limit 2000;
set enable_hashagg=on;
create table agg_zoo(x bigint, y int) distributed by (x);
insert into agg_zoo select random() * 12345678, 1 from generate_series(1,100000);
analyze agg_zoo;
set statement_mem="1600";
select sum(y) from agg_zoo;
select sum(y) from (select sum(y) as y from agg_zoo group by x) a;
Drop table agg_zoo;
--Generate
drop database if exists mpph_heap;
create database mpph_heap;
\c mpph_heap
CREATE TABLE customer (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL,
l_partkey integer NOT NULL,
l_suppkey integer NOT NULL,
l_linenumber integer NOT NULL,
l_quantity numeric(15,2) NOT NULL,
l_extendedprice numeric(15,2) NOT NULL,
l_discount numeric(15,2) NOT NULL,
l_tax numeric(15,2) NOT NULL,
l_returnflag character(1) NOT NULL,
l_linestatus character(1) NOT NULL,
l_shipdate date NOT NULL,
l_commitdate date NOT NULL,
l_receiptdate date NOT NULL,
l_shipinstruct character(25) NOT NULL,
l_shipmode character(10) NOT NULL,
l_comment character varying(44) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer,
n_name character(25),
n_regionkey integer,
n_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL,
o_custkey integer NOT NULL,
o_orderstatus character(1) NOT NULL,
o_totalprice numeric(15,2) NOT NULL,
o_orderdate date NOT NULL,
o_orderpriority character(15) NOT NULL,
o_clerk character(15) NOT NULL,
o_shippriority integer NOT NULL,
o_comment character varying(79) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL,
p_name character varying(55) NOT NULL,
p_mfgr character(25) NOT NULL,
p_brand character(10) NOT NULL,
p_type character varying(25) NOT NULL,
p_size integer NOT NULL,
p_container character(10) NOT NULL,
p_retailprice numeric(15,2) NOT NULL,
p_comment character varying(23) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL,
ps_suppkey integer NOT NULL,
ps_availqty integer NOT NULL,
ps_supplycost numeric(15,2) NOT NULL,
ps_comment character varying(199) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL,
r_name character(25) NOT NULL,
r_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL,
s_name character(25) NOT NULL,
s_address character varying(40) NOT NULL,
s_nationkey integer NOT NULL,
s_phone character(15) NOT NULL,
s_acctbal numeric(15,2) NOT NULL,
s_comment character varying(101) NOT NULL
)
WITH (appendonly=false) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT)from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
drop database if exists mpph_ao;
create database mpph_ao;
\c mpph_ao
CREATE TABLE customer (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL,
l_partkey integer NOT NULL,
l_suppkey integer NOT NULL,
l_linenumber integer NOT NULL,
l_quantity numeric(15,2) NOT NULL,
l_extendedprice numeric(15,2) NOT NULL,
l_discount numeric(15,2) NOT NULL,
l_tax numeric(15,2) NOT NULL,
l_returnflag character(1) NOT NULL,
l_linestatus character(1) NOT NULL,
l_shipdate date NOT NULL,
l_commitdate date NOT NULL,
l_receiptdate date NOT NULL,
l_shipinstruct character(25) NOT NULL,
l_shipmode character(10) NOT NULL,
l_comment character varying(44) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer,
n_name character(25),
n_regionkey integer,
n_comment character varying(152)
)
WITH (appendonly=false) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL,
o_custkey integer NOT NULL,
o_orderstatus character(1) NOT NULL,
o_totalprice numeric(15,2) NOT NULL,
o_orderdate date NOT NULL,
o_orderpriority character(15) NOT NULL,
o_clerk character(15) NOT NULL,
o_shippriority integer NOT NULL,
o_comment character varying(79) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL,
p_name character varying(55) NOT NULL,
p_mfgr character(25) NOT NULL,
p_brand character(10) NOT NULL,
p_type character varying(25) NOT NULL,
p_size integer NOT NULL,
p_container character(10) NOT NULL,
p_retailprice numeric(15,2) NOT NULL,
p_comment character varying(23) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL,
ps_suppkey integer NOT NULL,
ps_availqty integer NOT NULL,
ps_supplycost numeric(15,2) NOT NULL,
ps_comment character varying(199) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL,
r_name character(25) NOT NULL,
r_comment character varying(152)
)
WITH (appendonly=true) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL,
s_name character(25) NOT NULL,
s_address character varying(40) NOT NULL,
s_nationkey integer NOT NULL,
s_phone character(15) NOT NULL,
s_acctbal numeric(15,2) NOT NULL,
s_comment character varying(101) NOT NULL
)
WITH (appendonly=true) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT)from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
drop database if exists mpph_co;
create database mpph_co;
\c mpph_co
CREATE TABLE customer (
c_custkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_name character varying(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_address character varying(40) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_nationkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_phone character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_acctbal numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_mktsegment character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
c_comment character varying(117) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (c_custkey);
CREATE TABLE lineitem (
l_orderkey bigint NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_linenumber integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_quantity numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_extendedprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_discount numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_tax numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_returnflag character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_linestatus character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_commitdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_receiptdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipinstruct character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_shipmode character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
l_comment character varying(44) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (l_orderkey);
CREATE TABLE nation (
n_nationkey integer ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_name character(25) ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_regionkey integer ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
n_comment character varying(152) ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (n_nationkey);
CREATE TABLE orders (
o_orderkey bigint NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_custkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderstatus character(1) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_totalprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderdate date NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_orderpriority character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_clerk character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_shippriority integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
o_comment character varying(79) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (o_orderkey);
CREATE TABLE part (
p_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_name character varying(55) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_mfgr character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_brand character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_type character varying(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_size integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_container character(10) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_retailprice numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
p_comment character varying(23) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (p_partkey);
CREATE TABLE partsupp (
ps_partkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_availqty integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_supplycost numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
ps_comment character varying(199) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (ps_partkey);
CREATE TABLE region (
r_regionkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
r_name character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
r_comment character varying(152) ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (r_regionkey);
CREATE TABLE supplier (
s_suppkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_name character(25) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_address character varying(40) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_nationkey integer NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_phone character(15) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_acctbal numeric(15,2) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0),
s_comment character varying(101) NOT NULL ENCODING (compresstype=none,blocksize=32768,compresslevel=0)
)
WITH (appendonly=true, orientation=column) DISTRIBUTED BY (s_suppkey);
\copy customer (C_CUSTKEY,C_NAME,C_ADDRESS,C_NATIONKEY,C_PHONE,C_ACCTBAL,C_MKTSEGMENT,C_COMMENT) from 'data/customer.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem_small.csv' with delimiter '|';
\copy lineitem ( L_ORDERKEY, L_PARTKEY, L_SUPPKEY,L_LINENUMBER,L_QUANTITY, L_EXTENDEDPRICE,L_DISCOUNT,L_TAX,L_RETURNFLAG,L_LINESTATUS,L_SHIPDATE,L_COMMITDATE,L_RECEIPTDATE,L_SHIPINSTRUCT,L_SHIPMODE,L_COMMENT) from 'data/lineitem.csv' with delimiter '|';
\copy nation (N_NATIONKEY ,N_NAME, N_REGIONKEY,N_COMMENT) from 'data/nation.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order_small.csv' with delimiter '|';
\copy orders ( O_ORDERKEY,O_CUSTKEY,O_ORDERSTATUS,O_TOTALPRICE,O_ORDERDATE,O_ORDERPRIORITY,O_CLERK,O_SHIPPRIORITY,O_COMMENT) from 'data/order.csv' with delimiter '|';
\copy part (P_PARTKEY,P_NAME,P_MFGR,P_BRAND,P_TYPE,P_SIZE,P_CONTAINER,P_RETAILPRICE,P_COMMENT) from 'data/part.csv' with delimiter '|';
\copy partsupp (PS_PARTKEY,PS_SUPPKEY,PS_AVAILQTY,PS_SUPPLYCOST,PS_COMMENT ) from 'data/partsupp.csv' with delimiter '|';
\copy region ( R_REGIONKEY,R_NAME,R_COMMENT) from 'data/region.csv' with delimiter '|';
\copy supplier (S_SUPPKEY,S_NAME,S_ADDRESS,S_NATIONKEY,S_PHONE,S_ACCTBAL,S_COMMENT) from 'data/supplier.csv' with delimiter '|';
此差异已折叠。
......@@ -108,7 +108,7 @@ test: bfv_catalog bfv_index bfv_olap bfv_aggregate bfv_partition DML_over_joins
test: aggregate_with_groupingsets
test: nested_case_null sort
test: nested_case_null sort bb_mpph
# NOTE: The bfv_temp test assumes that there are no temporary tables in
# other sessions. Therefore the other tests in this group mustn't create
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册