Changeset: 1d879f878147 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d879f878147 Added Files: sql/test/group-concat/Tests/groupconcat01.test sql/test/group-concat/Tests/groupconcat02.test sql/test/group-concat/Tests/groupconcat03.test sql/test/group-concat/Tests/groupconcat04.test sql/test/group-concat/Tests/groupconcat05.test Branch: mtest Log Message:
Converted groupconcat tests diffs (truncated from 559 to 300 lines): diff --git a/sql/test/group-concat/Tests/groupconcat01.test b/sql/test/group-concat/Tests/groupconcat01.test new file mode 100644 --- /dev/null +++ b/sql/test/group-concat/Tests/groupconcat01.test @@ -0,0 +1,86 @@ +statement ok +start transaction + +statement ok +create table testme (a int, b clob) + +statement ok +insert into testme values (1, 'another'), (1, 'testing'), (1, 'todo') + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +1 +another,testing,todo + +statement ok +insert into testme values (2, 'lets'), (2, 'get'), (2, 'harder') + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +1 +another,testing,todo +2 +lets,get,harder + +statement ok +insert into testme values (3, 'even'), (2, 'more'), (1, 'serious') + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +1 +another,testing,todo,serious +2 +lets,get,harder,more +3 +even + +statement ok +insert into testme values (3, ''), (3, 'more'), (3, ''), (3, 'stress'), (4, NULL) + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +1 +another,testing,todo,serious +2 +lets,get,harder,more +3 +even,,more,,stress +4 +NULL + +statement ok +insert into testme values (3, NULL), (4, NULL) + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +1 +another,testing,todo,serious +2 +lets,get,harder,more +3 +even,,more,,stress +4 +NULL + +statement ok +insert into testme values (5, ''), (4, 'nothing'), (5, ''), (3, '') + +query IT rowsort +select a, group_concat(b) from testme group by a +---- +10 values hashing to d4b95fc43dc26f912a52bc31399e2c9f + +query IT rowsort +select a, group_concat(a) from testme group by a +---- +10 values hashing to d95622831967d7c9675a99155356077b + +statement ok +rollback + + diff --git a/sql/test/group-concat/Tests/groupconcat02.test b/sql/test/group-concat/Tests/groupconcat02.test new file mode 100644 --- /dev/null +++ b/sql/test/group-concat/Tests/groupconcat02.test @@ -0,0 +1,58 @@ +statement ok +start transaction + +statement ok +create table testme (b varchar(16)) + +statement ok +insert into testme values ('another'), ('testing'), ('all') + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all + +statement ok +insert into testme values ('lets'), ('get'), ('harder') + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all,lets,get,harder + +statement ok +insert into testme values ('even'), ('more'), ('serious') + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all,lets,get,harder,even,more,serious + +statement ok +insert into testme values (NULL) + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all,lets,get,harder,even,more,serious + +statement ok +delete from testme where b is null + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all,lets,get,harder,even,more,serious + +statement ok +insert into testme values (''), ('stress'), ('') + +query T rowsort +select group_concat(b) from testme +---- +another,testing,all,lets,get,harder,even,more,serious,,stress, + +statement ok +rollback + + diff --git a/sql/test/group-concat/Tests/groupconcat03.test b/sql/test/group-concat/Tests/groupconcat03.test new file mode 100644 --- /dev/null +++ b/sql/test/group-concat/Tests/groupconcat03.test @@ -0,0 +1,80 @@ +statement ok +start transaction + +statement ok +create table testme (b char(8)) + +statement ok +insert into testme values ('') + +query T rowsort +select group_concat(b) from testme +---- +(empty) + +statement ok +insert into testme values ('one'), ('two'), ('three') + +query T rowsort +select group_concat(b) from testme +---- +,one,two,three + +statement ok +insert into testme values ('') + +query T rowsort +select group_concat(b) from testme +---- +,one,two,three, + +statement ok +create table othertest (a int, b clob) + +statement ok +insert into othertest values (1, 'test'), (1, ''), (1, 'me') + +query IT rowsort +select a, group_concat(b) from othertest group by a +---- +1 +test,,me + +statement ok +insert into othertest values (2, 'other'), (2, 'test'), (2, '') + +query IT rowsort +select a, group_concat(b) from othertest group by a +---- +1 +test,,me +2 +other,test, + +statement ok +insert into othertest values (3, ''), (2, 'i want to see the commas'), (3, ''), (4, '') + +query IT rowsort +select a, group_concat(b) from othertest group by a +---- +1 +test,,me +2 +other,test,,i want to see the commas +3 +, +4 +(empty) + +query IT rowsort +select a, group_concat(b) as compacted from othertest group by a having count(*) > 2 +---- +1 +test,,me +2 +other,test,,i want to see the commas + +statement ok +rollback + + diff --git a/sql/test/group-concat/Tests/groupconcat04.test b/sql/test/group-concat/Tests/groupconcat04.test new file mode 100644 --- /dev/null +++ b/sql/test/group-concat/Tests/groupconcat04.test @@ -0,0 +1,99 @@ +statement ok +start transaction + +statement ok +create table testme (a int, b clob, c int) + +statement ok +insert into testme values (1, 'another', 1), (5, '', 20), (5, 'if', 20), (2, 'two', 2), (4, 'a singleton', 10), (5, 'else', 20) + +query IT rowsort +select a, group_concat(b) from testme where c > 3 group by a +---- +4 +a singleton +5 +,if,else + +query T rowsort +select group_concat(a) from testme +---- +1,5,5,2,4,5 + +query T rowsort +select '[' || group_concat(a) || ']' from testme +---- +[1,5,5,2,4,5] + +query T rowsort +select group_concat(c) from testme where c < 3 +---- +1,2 + +statement ok +insert into testme values (6, '', 12), (7, '', 323), (4, 'not a singleton anymore', 7), (7, NULL, 323) + +query IT rowsort +select a, group_concat(b) from testme where c > 3 group by a +---- +4 +a singleton,not a singleton anymore +5 +,if,else +6 +(empty) +7 +(empty) + +query T rowsort +select group_concat(a) from testme +---- +1,5,5,2,4,5,6,7,4,7 + +query T rowsort +select '[' || group_concat(a) || ']' from testme +---- +[1,5,5,2,4,5,6,7,4,7] _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list