提交 f3dac087 编写于 作者: H Heikki Linnakangas

Move/remove redundant test case from TINC.

This was mostly already in bfv_partition. For completeness, move the code
from the TINC test to bfv_partition to also execute the query, not just
EXPLAIN it.
上级 a0b02a7a
......@@ -69,6 +69,18 @@ select count_operator('explain select cust_type, subscription_status,count(disti
0
(1 row)
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
cust_type | subscription_status | count | sum | sum
-----------+---------------------+-------+------+------
| | 1 | 3.00 | 2.00
zyz | | 1 | 3.00 | 2.00
zyz | 1 | 1 | 1.00 | 1.00
zyz | 2 | 1 | 2.00 | 1.00
(4 rows)
-- CLEANUP
-- start_ignore
drop table mpp7980;
......
......@@ -69,6 +69,18 @@ select count_operator('explain select cust_type, subscription_status,count(disti
0
(1 row)
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
cust_type | subscription_status | count | sum | sum
-----------+---------------------+-------+------+------
| | 1 | 3.00 | 2.00
zyz | | 1 | 3.00 | 2.00
zyz | 1 | 1 | 1.00 | 1.00
zyz | 2 | 1 | 2.00 | 1.00
(4 rows)
-- CLEANUP
-- start_ignore
drop table mpp7980;
......
......@@ -62,6 +62,11 @@ distributed by (subscription_id, bill_stmt_id)
-- TEST
select count_operator('explain select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
-- CLEANUP
-- start_ignore
drop table mpp7980;
......
-- start_ignore
-- end_ignore
-- MPP-7980
-- Johnny Soedomo
create table mpp7980
(
month_id date,
bill_stmt_id character varying(30),
cust_type character varying(10),
subscription_status character varying(30),
voice_call_min numeric(15,2),
minute_per_call numeric(15,2),
subscription_id character varying(15)
)
distributed by (subscription_id, bill_stmt_id)
PARTITION BY RANGE(month_id)
(
start ('2009-02-01'::date) end ('2009-08-01'::date) exclusive EVERY (INTERVAL '1 month')
);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_1" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_2" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_3" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_4" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_5" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_6" for table "mpp7980"
CREATE TABLE
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
INSERT 0 1
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
INSERT 0 1
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
INSERT 0 1
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
cust_type | subscription_status | count | sum | sum
-----------+---------------------+-------+------+------
zyz | 1 | 1 | 1.00 | 1.00
zyz | 2 | 1 | 2.00 | 1.00
zyz | | 1 | 3.00 | 2.00
| | 1 | 3.00 | 2.00
(4 rows)
drop table mpp7980;
DROP TABLE
-- start_ignore
-- end_ignore
-- MPP-7980
-- Johnny Soedomo
create table mpp7980
(
month_id date,
bill_stmt_id character varying(30),
cust_type character varying(10),
subscription_status character varying(30),
voice_call_min numeric(15,2),
minute_per_call numeric(15,2),
subscription_id character varying(15)
)
distributed by (subscription_id, bill_stmt_id)
PARTITION BY RANGE(month_id)
(
start ('2009-02-01'::date) end ('2009-08-01'::date) exclusive EVERY (INTERVAL '1 month')
);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_1" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_2" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_3" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_4" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_5" for table "mpp7980"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_6" for table "mpp7980"
CREATE TABLE
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
INSERT 0 1
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
INSERT 0 1
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
INSERT 0 1
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
cust_type | subscription_status | count | sum | sum
-----------+---------------------+-------+------+------
zyz | 1 | 1 | 1.00 | 1.00
zyz | 2 | 1 | 2.00 | 1.00
zyz | | 1 | 3.00 | 2.00
| | 1 | 3.00 | 2.00
(4 rows)
drop table mpp7980;
DROP TABLE
-- MPP-7980
-- Johnny Soedomo
create table mpp7980
(
month_id date,
bill_stmt_id character varying(30),
cust_type character varying(10),
subscription_status character varying(30),
voice_call_min numeric(15,2),
minute_per_call numeric(15,2),
subscription_id character varying(15)
)
distributed by (subscription_id, bill_stmt_id)
PARTITION BY RANGE(month_id)
(
start ('2009-02-01'::date) end ('2009-08-01'::date) exclusive EVERY (INTERVAL '1 month')
);
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
insert into mpp7980 values('2009-03-03','xyz','zyz','4',1,3,'1');
select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id ='2009-04-01' group by rollup(1,2);
drop table mpp7980;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册