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

The DISTINCT case for value-based partitioning


diffs (195 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
@@ -60,6 +60,7 @@ partition00
 partition01
 partition02
 partition03
+partition04
 printf
 #some remote related tests
 mapi04
diff --git a/monetdb5/modules/mal/Tests/partition04.malC 
b/monetdb5/modules/mal/Tests/partition04.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition04.malC
@@ -0,0 +1,64 @@
+#inspired by SQL
+# function user.s6_1():void;                                                   
                          |
+#     X_1:void := querylog.define("select count(distinct i) from tmp;":str, 
"default_pipe":str, 14: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_17:bat[:int] := algebra.projection(C_5:bat[:oid], X_8:bat[:int]);      
                          |
+#     (X_18:bat[:oid], C_19:bat[:oid], X_20:bat[:lng]) := 
group.groupdone(X_17:bat[:int]);               |
+#     X_21:bat[:int] := algebra.projection(C_19:bat[:oid], X_17:bat[:int]);    
                          |
+#     X_22:lng := aggr.count(X_21:bat[:int], true:bit);                        
                          |
+#     sql.resultSet("sys.L4":str, "L3":str, "bigint":str, 64:int, 0:int, 
7:int, X_22:lng);               |
+# end user.s6_1;                                                               
                          |
+
+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);
+k := algebra.projection(g,d);
+a:= aggr.count(k);
+io.print(a);
+
+(k1,k2,k3,k4):= partition.slice(d);
+p1 := algebra.projection(k1,d);
+p2 := algebra.projection(k2,d);
+p3 := algebra.projection(k3,d);
+p4 := algebra.projection(k4,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);
+j1 := algebra.projection(g1,p1);
+j2 := algebra.projection(g2,p2);
+j3 := algebra.projection(g3,p3);
+j4 := algebra.projection(g4,p4);
+s1 := aggr.count(j1,true);
+s2 := aggr.count(j2,true);
+s3 := aggr.count(j3,true);
+s4 := aggr.count(j4,true);
+m := mat.pack(s1,s2,s3,s4);
+a4:= aggr.sum(m);
+io.print(a4);
+
diff --git a/monetdb5/modules/mal/Tests/partition04.stable.err 
b/monetdb5/modules/mal/Tests/partition04.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition04.stable.err
@@ -0,0 +1,34 @@
+stderr of test 'partition04` in directory 'monetdb5/modules/mal` itself:
+
+
+# 14:13:20 >  
+# 14:13:20 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38430" "--set" 
"mapi_usock=/var/tmp/mtest-7207/.s.monetdb.38430" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 14:13:20 >  
+
+# 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 = 38430
+# cmdline opt  mapi_usock = /var/tmp/mtest-7207/.s.monetdb.38430
+# 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
+
+# 14:13:20 >  
+# 14:13:20 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-7207" "--port=38430"
+# 14:13:20 >  
+
+
+# 14:13:20 >  
+# 14:13:20 >  "Done."
+# 14:13:20 >  
+
diff --git a/monetdb5/modules/mal/Tests/partition04.stable.out 
b/monetdb5/modules/mal/Tests/partition04.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/partition04.stable.out
@@ -0,0 +1,71 @@
+stdout of test 'partition04` in directory 'monetdb5/modules/mal` itself:
+
+
+# 14:13:20 >  
+# 14:13:20 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38430" "--set" 
"mapi_usock=/var/tmp/mtest-7207/.s.monetdb.38430" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/home/mk/partition//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
+# 14:13:20 >  
+
+# 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:38430/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-7207/.s.monetdb.38430
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 14:13:20 >  
+# 14:13:20 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-7207" "--port=38430"
+# 14:13:20 >  
+
+#--------------------------#
+# 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       ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 0@0     ]
+[ 1@0, 1@0     ]
+[ 2@0, 1@0     ]
+[ 3@0, 2@0     ]
+[ 4@0, 2@0     ]
+[ 5@0, 3@0     ]
+[ 6@0, 3@0     ]
+[ 7@0, 4@0     ]
+[ 8@0, 4@0     ]
+[ 9@0, 5@0     ]
+#--------------------------#
+# t    t       t  # name
+# void oid     lng  # type
+#--------------------------#
+[ 0@0, 0@0,    1       ]
+[ 1@0, 1@0,    2       ]
+[ 2@0, 3@0,    2       ]
+[ 3@0, 5@0,    2       ]
+[ 4@0, 7@0,    2       ]
+[ 5@0, 9@0,    1       ]
+[ 6    ]
+[ 6    ]
+
+# 14:13:20 >  
+# 14:13:20 >  "Done."
+# 14:13:20 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to