Skip to content

Commit 6898e1d

Browse files
committed
Add regression test
1 parent 5801fb0 commit 6898e1d

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ OBJS = vops.o
66
EXTENSION = vops
77
DATA = vops--1.0.sql
88
PGFILEDESC = "vops - vectorized operations"
9-
#CUSTOM_COPT = -O3
9+
CUSTOM_COPT = -O3
1010

11-
REGRESS = test.sql
11+
REGRESS = test
1212

1313
ifdef USE_PGXS
1414
PG_CONFIG = pg_config

sql/test.out renamed to expected/test.out

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,58 @@
1-
CREATE EXTENSION
2-
CREATE TABLE
3-
CREATE TABLE
4-
INSERT 0 6
1+
create extension vops;
2+
create table s(x real);
3+
create table v(x vops_float4);
4+
insert into s values(1.0),(2.0),(null),(3.0),(null),(4.0);
5+
select populate(destination:='v'::regclass, source:='s'::regclass);
56
populate
67
----------
78

89
(1 row)
910

11+
select unnest(v.*) from v where x > 1;
1012
unnest
1113
--------
1214
(2)
1315
(3)
1416
(4)
1517
(3 rows)
1618

19+
select countall(*) from v where x is not null;
1720
countall
1821
----------
1922
4
2023
(1 row)
2124

25+
select count(*) from v where x is null;
2226
count
2327
-------
2428
60
2529
(1 row)
2630

31+
select count(*) from v where x is not null;
2732
count
2833
-------
2934
4
3035
(1 row)
3136

37+
select count(*),count(x),sum(x),avg(x),min(x),max(x),variance(x),var_pop(x),var_samp(x),stddev(x),stddev_pop(x),stddev_samp(x) from v where x >= 0.0;
3238
count | count | sum | avg | min | max | variance | var_pop | var_samp | stddev | stddev_pop | stddev_samp
3339
-------+-------+-----+-----+-----+-----+------------------+---------+------------------+------------------+------------------+------------------
3440
4 | 4 | 10 | 2.5 | 1 | 4 | 1.66666666666667 | 1.25 | 1.66666666666667 | 1.29099444873581 | 1.11803398874989 | 1.29099444873581
3541
(1 row)
3642

43+
select count(*),count(x),sum(x),avg(x),min(x),max(x),variance(x),var_pop(x),var_samp(x),stddev(x),stddev_pop(x),stddev_samp(x) from s where x >= 0.0;
3744
count | count | sum | avg | min | max | variance | var_pop | var_samp | stddev | stddev_pop | stddev_samp
3845
-------+-------+-----+-----+-----+-----+------------------+---------+------------------+------------------+------------------+------------------
3946
4 | 4 | 10 | 2.5 | 1 | 4 | 1.66666666666667 | 1.25 | 1.66666666666667 | 1.29099444873581 | 1.11803398874989 | 1.29099444873581
4047
(1 row)
4148

49+
select count(*),count(x),sum(x),avg(x),min(x),max(x),variance(x),var_pop(x),var_samp(x),stddev(x),stddev_pop(x),stddev_samp(x) from v where x > 1.0;
4250
count | count | sum | avg | min | max | variance | var_pop | var_samp | stddev | stddev_pop | stddev_samp
4351
-------+-------+-----+-----+-----+-----+----------+-------------------+----------+--------+-------------------+-------------
4452
3 | 3 | 9 | 3 | 2 | 4 | 1 | 0.666666666666667 | 1 | 1 | 0.816496580927726 | 1
4553
(1 row)
4654

55+
select count(*),count(x),sum(x),avg(x),min(x),max(x),variance(x),var_pop(x),var_samp(x),stddev(x),stddev_pop(x),stddev_samp(x) from s where x > 1.0;
4756
count | count | sum | avg | min | max | variance | var_pop | var_samp | stddev | stddev_pop | stddev_samp
4857
-------+-------+-----+-----+-----+-----+----------+-------------------+----------+--------+-------------------+-------------
4958
3 | 3 | 9 | 3 | 2 | 4 | 1 | 0.666666666666667 | 1 | 1 | 0.816496580927726 | 1

0 commit comments

Comments
 (0)