Changeset: d808654a54bb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d808654a54bb
Added Files:
        monetdb5/modules/mal/Tests/partition00.malC
        monetdb5/modules/mal/Tests/partition00.stable.err
        monetdb5/modules/mal/Tests/partition00.stable.out
        monetdb5/modules/mal/Tests/partition01.malC
        monetdb5/modules/mal/Tests/partition01.stable.err
        monetdb5/modules/mal/Tests/partition01.stable.out
        monetdb5/modules/mal/Tests/partition02.malC
        monetdb5/modules/mal/Tests/partition02.stable.err
        monetdb5/modules/mal/Tests/partition02.stable.out
        monetdb5/modules/mal/Tests/partition03.malC
        monetdb5/modules/mal/Tests/partition03.stable.err
        monetdb5/modules/mal/Tests/partition03.stable.out
Modified Files:
        monetdb5/modules/mal/Tests/All
Branch: partition
Log Message:

Examples of value based partitioned aggregation


diffs (truncated from 791 to 300 lines):

diff --git a/monetdb5/modules/mal/Tests/All b/monetdb5/modules/mal/Tests/All
--- a/monetdb5/modules/mal/Tests/All
+++ b/monetdb5/modules/mal/Tests/All
@@ -56,6 +56,10 @@ remoteInit
 partition
 batpartition
 hashpartition
+partition00
+partition01
+partition02
+partition03
 printf
 #some remote related tests
 mapi04
diff --git a/monetdb5/modules/mal/Tests/partition00.malC 
b/monetdb5/modules/mal/Tests/partition00.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition00.malC
@@ -0,0 +1,48 @@
+# inspired by SQL query
+# function user.s12_1():void;                                                  
                         |
+#     X_1:void := querylog.define("explain select count(*) from tmp;":str, 
"minimal_pipe":str, 12:int); |
+#     X_4:int := sql.mvc();                                                    
                         |
+#     C_5:bat[:oid] := sql.tid(X_4:int, "sys":str, "tmp":str);                 
                         |
+#     X_8:bat[:int] := sql.bind(X_4:int, "sys":str, "tmp":str, "k":str, 
0:int);                         |
+#     X_11:bat[:int] := sql.emptybind(X_4:int, "sys":str, "tmp":str, "k":str, 
1:int);                   |
+#     (C_13:bat[:oid], X_14:bat[:int]) := sql.emptybind(X_4:int, "sys":str, 
"tmp":str, "k":str, 2:int); |
+#     X_16:bat[:int] := sql.delta(X_8:bat[:int], C_13:bat[:oid], 
X_14:bat[:int], X_11:bat[:int]);       |
+#     X_17:bat[:int] := algebra.projection(C_5:bat[:oid], X_16:bat[:int]);     
                         |
+#     X_18:lng := aggr.count(X_17:bat[:int]);                                  
                         |
+#     sql.resultSet("sys.L4":str, "L3":str, "bigint":str, 64:int, 0:int, 
7:int, X_18:lng);   
+#
+b:= bat.new(:int);
+bat.append(b,0);
+bat.append(b,1);
+bat.append(b,2);
+bat.append(b,3);
+bat.append(b,4);
+bat.append(b,5);
+bat.append(b,6);
+bat.append(b,7);
+bat.append(b,8);
+bat.append(b,9);
+c:= bat.new(:int);
+bat.append(c,0);
+bat.append(c,1);
+bat.append(c,1);
+bat.append(c,2);
+bat.append(c,2);
+bat.append(c,3);
+bat.append(c,3);
+bat.append(c,4);
+bat.append(c,4);
+bat.append(c,5);
+io.print(b,c);
+a:= aggr.count(b);
+io.print(a);
+
+(p1,p2,p3,p4):= partition.hash(b);
+c1:= aggr.count(p1);
+c2:= aggr.count(p2);
+c3:= aggr.count(p3);
+c4:= aggr.count(p4);
+m := mat.pack(c1,c2,c3,c4);
+s := aggr.sum(m);
+io.print(s);
+
diff --git a/monetdb5/modules/mal/Tests/partition00.stable.err 
b/monetdb5/modules/mal/Tests/partition00.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition00.stable.err
@@ -0,0 +1,34 @@
+stderr of test 'partition00` in directory 'monetdb5/modules/mal` itself:
+
+
+# 10:10:27 >  
+# 10:10:27 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39228" "--set" 
"mapi_usock=/var/tmp/mtest-23193/.s.monetdb.39228" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 10:10:27 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/home/mk/partition//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 39228
+# cmdline opt  mapi_usock = /var/tmp/mtest-23193/.s.monetdb.39228
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal
+# cmdline opt  gdk_debug = 553648138
+
+# 10:10:28 >  
+# 10:10:28 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-23193" "--port=39228"
+# 10:10:28 >  
+
+
+# 10:10:28 >  
+# 10:10:28 >  "Done."
+# 10:10:28 >  
+
diff --git a/monetdb5/modules/mal/Tests/partition00.stable.out 
b/monetdb5/modules/mal/Tests/partition00.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition00.stable.out
@@ -0,0 +1,47 @@
+stdout of test 'partition00` in directory 'monetdb5/modules/mal` itself:
+
+
+# 10:10:27 >  
+# 10:10:27 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39228" "--set" 
"mapi_usock=/var/tmp/mtest-23193/.s.monetdb.39228" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 10:10:27 >  
+
+# MonetDB 5 server v11.28.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_modules_mal', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 15.581 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on 
mapi:monetdb://rocks073.scilens.private:39228/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-23193/.s.monetdb.39228
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 10:10:28 >  
+# 10:10:28 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-23193" "--port=39228"
+# 10:10:28 >  
+
+#--------------------------#
+# t    t       t  # name
+# void int     int  # type
+#--------------------------#
+[ 0@0, 0,      0       ]
+[ 1@0, 1,      1       ]
+[ 2@0, 2,      1       ]
+[ 3@0, 3,      2       ]
+[ 4@0, 4,      2       ]
+[ 5@0, 5,      3       ]
+[ 6@0, 6,      3       ]
+[ 7@0, 7,      4       ]
+[ 8@0, 8,      4       ]
+[ 9@0, 9,      5       ]
+[ 10   ]
+[ 10   ]
+
+# 10:10:28 >  
+# 10:10:28 >  "Done."
+# 10:10:28 >  
+
diff --git a/monetdb5/modules/mal/Tests/partition01.malC 
b/monetdb5/modules/mal/Tests/partition01.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition01.malC
@@ -0,0 +1,52 @@
+# inspired by SQL query
+# function user.s14_1():void;                                                  
                                      |
+#     X_1:void := querylog.define("select count(*) from tmp group by i;":str, 
"minimal_pipe":str, 24:int);           |
+#     X_4:int := sql.mvc();                                                    
                                      |
+#     C_5:bat[:oid] := sql.tid(X_4:int, "sys":str, "tmp":str);                 
                                      |
+#     X_8:bat[:int] := sql.bind(X_4:int, "sys":str, "tmp":str, "i":str, 
0:int);                                      |
+#     X_11:bat[:int] := sql.emptybind(X_4:int, "sys":str, "tmp":str, "i":str, 
1:int);                                |
+#     (C_13:bat[:oid], X_14:bat[:int]) := sql.emptybind(X_4:int, "sys":str, 
"tmp":str, "i":str, 2:int);              |
+#     X_16:bat[:int] := sql.delta(X_8:bat[:int], C_13:bat[:oid], 
X_14:bat[:int], X_11:bat[:int]);                    |
+#     X_17:bat[:int] := algebra.projection(C_5:bat[:oid], X_16:bat[:int]);     
                                      |
+#     (X_18:bat[:oid], C_19:bat[:oid], X_20:bat[:lng]) := 
group.groupdone(X_17:bat[:int]);                           |
+#     X_22:bat[:lng] := aggr.subcount(X_18:bat[:oid], X_18:bat[:oid], 
C_19:bat[:oid], false:bit);                    |
+b:= bat.new(:int);
+bat.append(b,0);
+bat.append(b,1);
+bat.append(b,2);
+bat.append(b,3);
+bat.append(b,4);
+bat.append(b,5);
+bat.append(b,6);
+bat.append(b,7);
+bat.append(b,8);
+bat.append(b,9);
+d:= bat.new(:int);
+bat.append(d,0);
+bat.append(d,1);
+bat.append(d,1);
+bat.append(d,2);
+bat.append(d,2);
+bat.append(d,3);
+bat.append(d,3);
+bat.append(d,4);
+bat.append(d,4);
+bat.append(d,5);
+io.print(b,d);
+(o,g,c):= group.groupdone(d);
+io.print(o);
+io.print(g,c);
+a:= aggr.subcount(o,o,g,false);
+io.print(a);
+
+(p1,p2,p3,p4):= partition.hash(d);
+(o1,g1,c1):= group.groupdone(p1);
+(o2,g2,c2):= group.groupdone(p2);
+(o3,g3,c3):= group.groupdone(p3);
+(o4,g4,c4):= group.groupdone(p4);
+a1:= aggr.subcount(o1,o1,g1,false);
+a2:= aggr.subcount(o2,o2,g2,false);
+a3:= aggr.subcount(o3,o3,g3,false);
+a4:= aggr.subcount(o4,o4,g4,false);
+m := mat.pack(a1,a2,a3,a4);
+io.print(m);
diff --git a/monetdb5/modules/mal/Tests/partition01.stable.err 
b/monetdb5/modules/mal/Tests/partition01.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition01.stable.err
@@ -0,0 +1,34 @@
+stderr of test 'partition01` in directory 'monetdb5/modules/mal` itself:
+
+
+# 10:10:28 >  
+# 10:10:28 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39228" "--set" 
"mapi_usock=/var/tmp/mtest-23193/.s.monetdb.39228" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 10:10:28 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/home/mk/partition//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 39228
+# cmdline opt  mapi_usock = /var/tmp/mtest-23193/.s.monetdb.39228
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal
+# cmdline opt  gdk_debug = 553648138
+
+# 10:10:28 >  
+# 10:10:28 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-23193" "--port=39228"
+# 10:10:28 >  
+
+
+# 10:10:28 >  
+# 10:10:28 >  "Done."
+# 10:10:28 >  
+
diff --git a/monetdb5/modules/mal/Tests/partition01.stable.out 
b/monetdb5/modules/mal/Tests/partition01.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition01.stable.out
@@ -0,0 +1,89 @@
+stdout of test 'partition01` in directory 'monetdb5/modules/mal` itself:
+
+
+# 10:10:28 >  
+# 10:10:28 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39228" "--set" 
"mapi_usock=/var/tmp/mtest-23193/.s.monetdb.39228" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 10:10:28 >  
+
+# MonetDB 5 server v11.28.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_modules_mal', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 15.581 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on 
mapi:monetdb://rocks073.scilens.private:39228/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-23193/.s.monetdb.39228
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 10:10:28 >  
+# 10:10:28 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-23193" "--port=39228"
+# 10:10:28 >  
+
+#--------------------------#
+# t    t       t  # name
+# void int     int  # type
+#--------------------------#
+[ 0@0, 0,      0       ]
+[ 1@0, 1,      1       ]
+[ 2@0, 2,      1       ]
+[ 3@0, 3,      2       ]
+[ 4@0, 4,      2       ]
+[ 5@0, 5,      3       ]
+[ 6@0, 6,      3       ]
+[ 7@0, 7,      4       ]
+[ 8@0, 8,      4       ]
+[ 9@0, 9,      5       ]
+#--------------------------#
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to