Changeset: 71c4b0a6ea92 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=71c4b0a6ea92
Added Files:
        monetdb5/extras/rapi/Tests/rapi04.stable.err
        monetdb5/extras/rapi/Tests/rapi04.stable.out
        monetdb5/extras/rapi/Tests/rapi05.stable.err
        monetdb5/extras/rapi/Tests/rapi05.stable.out
Modified Files:
        monetdb5/extras/rapi/Tests/rapi04.mal
        monetdb5/extras/rapi/Tests/rapi05.mal
        monetdb5/extras/rapi/rapi.c
Branch: RIntegration
Log Message:

Two more tests finished


diffs (257 lines):

diff --git a/monetdb5/extras/rapi/Tests/rapi04.mal 
b/monetdb5/extras/rapi/Tests/rapi04.mal
--- a/monetdb5/extras/rapi/Tests/rapi04.mal
+++ b/monetdb5/extras/rapi/Tests/rapi04.mal
@@ -1,7 +1,7 @@
-b1:= bat.new(:oid,:int);
-bat.append(b1,1);
-bat.append(b1,2);
-bat.append(b1,3);
+b1:= bat.new(:oid,:dbl);
+bat.append(b1,1.0:dbl);
+bat.append(b1,2.0:dbl);
+bat.append(b1,3.0:dbl);
 
 b2:= bat.new(:oid,:int);
 bat.append(b2,1);
diff --git a/monetdb5/extras/rapi/Tests/rapi04.stable.err 
b/monetdb5/extras/rapi/Tests/rapi04.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/rapi/Tests/rapi04.stable.err
@@ -0,0 +1,29 @@
+stderr of test 'rapi04` in directory 'monetdb5/extras/rapi` itself:
+
+
+# 13:51:29 >  
+# 13:51:29 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36601" "--set" 
"mapi_usock=/var/tmp/mtest-19338/.s.monetdb.36601" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi"
 "rapi04.mal"
+# 13:51:29 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/rapi//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = yes
+# 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 = 36601
+# cmdline opt  mapi_usock = /var/tmp/mtest-19338/.s.monetdb.36601
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi
+
+# 13:51:30 >  
+# 13:51:30 >  "Done."
+# 13:51:30 >  
+
diff --git a/monetdb5/extras/rapi/Tests/rapi04.stable.out 
b/monetdb5/extras/rapi/Tests/rapi04.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/rapi/Tests/rapi04.stable.out
@@ -0,0 +1,50 @@
+stdout of test 'rapi04` in directory 'monetdb5/extras/rapi` itself:
+
+
+# 13:51:29 >  
+# 13:51:29 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36601" "--set" 
"mapi_usock=/var/tmp/mtest-19338/.s.monetdb.36601" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi"
 "rapi04.mal"
+# 13:51:29 >  
+
+# MonetDB 5 server v11.18.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_extras_rapi', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.591 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://vienna.ins.cwi.nl:36601/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-19338/.s.monetdb.36601
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+    b1 := bat.new(:oid,:dbl);
+    bat.append(b1,1:dbl);
+    bat.append(b1,2:dbl);
+    bat.append(b1,3:dbl);
+    b2 := bat.new(:oid,:int);
+    bat.append(b2,1);
+    bat.append(b2,2);
+    bat.append(b2,3);
+    (r:bat[:oid,:dbl] ,s:bat[:oid,:dbl] ) := 
rapi.eval("print(arg1);print(arg2); print(arg3); 
print(arg4);data.frame(r=arg1,s=as.numeric((smooth(Re(fft(arg1)),kind=arg4)+arg2)/arg3))[1:2,]",b1,b2,42:int,"3RSR");
+    io.print(r,s);
+end main;
+# User R expression: print(arg1);print(arg2); print(arg3); 
print(arg4);data.frame(r=arg1,s=as.numeric((smooth(Re(fft(arg1)),kind=arg4)+arg2)/arg3))[1:2,]
+# Executed R expression ret <- 
as.data.frame((function(arg1,arg2,arg3,arg4){print(arg1);print(arg2); 
print(arg3); 
print(arg4);data.frame(r=arg1,s=as.numeric((smooth(Re(fft(arg1)),kind=arg4)+arg2)/arg3))[1:2,]})(arg1,arg2,arg3,arg4),nm=NA,stringsAsFactors=F)
+
+#[1]# 1# 2# 3#
+#[1]# 1# 2# 3#
+#[1]# 42#
+#[1]# "3RSR"#
+#--------------------------#
+# h    t       t  # name
+# void dbl     dbl  # type
+#--------------------------#
+[ 0@0, 1,      -0.011904761904761904  ]
+[ 1@0, 2,      0.011904761904761904  ]
+
+# 13:51:30 >  
+# 13:51:30 >  "Done."
+# 13:51:30 >  
+
diff --git a/monetdb5/extras/rapi/Tests/rapi05.mal 
b/monetdb5/extras/rapi/Tests/rapi05.mal
--- a/monetdb5/extras/rapi/Tests/rapi05.mal
+++ b/monetdb5/extras/rapi/Tests/rapi05.mal
@@ -10,17 +10,17 @@ bat.append(g,2);
 bat.append(g,3);
 bat.append(g,1);
 
-b:= bat.new(:oid,:int);
-bat.append(b,1804289383);
-bat.append(b,846930886);
-bat.append(b,1681692777);
-bat.append(b,1714636915);
-bat.append(b,1957747793);
-bat.append(b,424238335);
-bat.append(b,719885386);
-bat.append(b,1649760492);
-bat.append(b,596516649);
-bat.append(b,1189641421);
+b:= bat.new(:oid,:dbl);
+bat.append(b,1804289383:dbl);
+bat.append(b,846930886:dbl);
+bat.append(b,1681692777:dbl);
+bat.append(b,1714636915:dbl);
+bat.append(b,1957747793:dbl);
+bat.append(b,424238335:dbl);
+bat.append(b,719885386:dbl);
+bat.append(b,1649760492:dbl);
+bat.append(b,596516649:dbl);
+bat.append(b,1189641421:dbl);
 
 (r:bat[:oid,:int], s:bat[:oid,:dbl]) := 
rapi.eval("aggregate(arg1,by=list(arg2),FUN=function(x){sort(x)[max(length(x)-arg3,0)]})",b,g,1);
 
diff --git a/monetdb5/extras/rapi/Tests/rapi05.stable.err 
b/monetdb5/extras/rapi/Tests/rapi05.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/rapi/Tests/rapi05.stable.err
@@ -0,0 +1,29 @@
+stderr of test 'rapi05` in directory 'monetdb5/extras/rapi` itself:
+
+
+# 14:05:12 >  
+# 14:05:12 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38561" "--set" 
"mapi_usock=/var/tmp/mtest-18551/.s.monetdb.38561" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi"
 "rapi05.mal"
+# 14:05:12 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/rapi//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = yes
+# 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 = 38561
+# cmdline opt  mapi_usock = /var/tmp/mtest-18551/.s.monetdb.38561
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi
+
+# 14:05:12 >  
+# 14:05:12 >  "Done."
+# 14:05:12 >  
+
diff --git a/monetdb5/extras/rapi/Tests/rapi05.stable.out 
b/monetdb5/extras/rapi/Tests/rapi05.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/rapi/Tests/rapi05.stable.out
@@ -0,0 +1,61 @@
+stdout of test 'rapi05` in directory 'monetdb5/extras/rapi` itself:
+
+
+# 14:05:12 >  
+# 14:05:12 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38561" "--set" 
"mapi_usock=/var/tmp/mtest-18551/.s.monetdb.38561" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi"
 "rapi05.mal"
+# 14:05:12 >  
+
+# MonetDB 5 server v11.18.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_extras_rapi', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.591 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://vienna.ins.cwi.nl:38561/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-18551/.s.monetdb.38561
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+    g := bat.new(:oid,:int);
+    bat.append(g,1);
+    bat.append(g,2);
+    bat.append(g,3);
+    bat.append(g,1);
+    bat.append(g,2);
+    bat.append(g,3);
+    bat.append(g,1);
+    bat.append(g,2);
+    bat.append(g,3);
+    bat.append(g,1);
+    b := bat.new(:oid,:dbl);
+    bat.append(b,1804289383:dbl);
+    bat.append(b,846930886:dbl);
+    bat.append(b,1681692777:dbl);
+    bat.append(b,1714636915:dbl);
+    bat.append(b,1957747793:dbl);
+    bat.append(b,424238335:dbl);
+    bat.append(b,719885386:dbl);
+    bat.append(b,1649760492:dbl);
+    bat.append(b,596516649:dbl);
+    bat.append(b,1189641421:dbl);
+    (r:bat[:oid,:int] ,s:bat[:oid,:dbl] ) := 
rapi.eval("aggregate(arg1,by=list(arg2),FUN=function(x){sort(x)[max(length(x)-arg3,0)]})",b,g,1);
+    io.print(r,s);
+end main;
+# User R expression: 
aggregate(arg1,by=list(arg2),FUN=function(x){sort(x)[max(length(x)-arg3,0)]})
+# Executed R expression ret <- 
as.data.frame((function(arg1,arg2,arg3){aggregate(arg1,by=list(arg2),FUN=function(x){sort(x)[max(length(x)-arg3,0)]})})(arg1,arg2,arg3),nm=NA,stringsAsFactors=F)
+
+#--------------------------#
+# h    t       t  # name
+# void int     dbl  # type
+#--------------------------#
+[ 0@0, 1,      1714636915  ]
+[ 1@0, 2,      1649760492  ]
+[ 2@0, 3,      596516649  ]
+
+# 14:05:12 >  
+# 14:05:12 >  "Done."
+# 14:05:12 >  
+
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -81,7 +81,7 @@
        tpe *p, prev = tpe##_nil; \
        b = BATnew(TYPE_void, TYPE_##tpe, cnt);\
        BATseqbase(b, 0); b->T->nil = 0; b->T->nonil = 1; b->tkey = 0;\
-       b->tsorted = 1; b->trevsorted = 1; b->tdense = 1;\
+       b->tsorted = 1; b->trevsorted = 1; \
        p = (tpe*) Tloc(b, BUNfirst(b));\
        for( j =0; j< (int) cnt; j++, p++){\
                *p = (tpe) access_fun(ret_col)[j];\
@@ -98,6 +98,8 @@
                } \
                prev = *p; \
        } \
+       BATsetcount(b,cnt);\
+       BATsettrivprop(b);\
 }
 
 // The R-environment should be single threaded, calling for some protective 
measures.
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to