Changeset: 5cbbf29cee3a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5cbbf29cee3a Added Files: monetdb5/extras/jaql/Tests/group01.stable.err monetdb5/extras/jaql/Tests/group01.stable.out Modified Files: monetdb5/extras/jaql/Tests/All Branch: jacqueline Log Message:
Add group01 test now it works diffs (91 lines): diff --git a/monetdb5/extras/jaql/Tests/All b/monetdb5/extras/jaql/Tests/All --- a/monetdb5/extras/jaql/Tests/All +++ b/monetdb5/extras/jaql/Tests/All @@ -23,8 +23,7 @@ plan02 filter01 transform01 expand01 -#todo -#group01 +group01 join01 sort01 top01 diff --git a/monetdb5/extras/jaql/Tests/group01.stable.err b/monetdb5/extras/jaql/Tests/group01.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/extras/jaql/Tests/group01.stable.err @@ -0,0 +1,33 @@ +stderr of test 'group01` in directory 'extras/jaql` itself: + + +# 11:42:27 > +# 11:42:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "gdk_dbfarm=/net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-jacqueline-sofia.ins.cwi.nl/five/dbfarm" "--set" "mapi_open=true" "--set" "mapi_port=31815" "--set" "monet_prompt=" "--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_extras_jaql" "group01.mal" +# 11:42:27 > + +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = /ufs/fabian/scratch/ssd/monetdb/jacqueline/program-x86_64/var/lib/monetdb5/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# 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 gdk_dbfarm = /net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-jacqueline-sofia.ins.cwi.nl/five/dbfarm +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 31815 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_extras_jaql + + + +# 11:42:27 > +# 11:42:27 > "Done." +# 11:42:27 > + diff --git a/monetdb5/extras/jaql/Tests/group01.stable.out b/monetdb5/extras/jaql/Tests/group01.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/extras/jaql/Tests/group01.stable.out @@ -0,0 +1,35 @@ +stdout of test 'group01` in directory 'extras/jaql` itself: + + +# 11:42:27 > +# 11:42:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "gdk_dbfarm=/net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-jacqueline-sofia.ins.cwi.nl/five/dbfarm" "--set" "mapi_open=true" "--set" "mapi_port=31815" "--set" "monet_prompt=" "--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_extras_jaql" "group01.mal" +# 11:42:27 > + +# MonetDB 5 server v11.10.0 "jacqueline-a5c6dd189a73+" +# Serving database 'mTests_extras_jaql', using 8 threads +# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 15.630 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://sofia.ins.cwi.nl:31815/ +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +function user.main():void; +# from the docs + jaql.x("employees = [ {\"id\":1, \"dept\": 1, \"income\":12000}, {\"id\":2, \"dept\": 1, \"income\":13000}, {\"id\":3, \"dept\": 2, \"income\":15000}, {\"id\":4, \"dept\": 1, \"income\":10000}, {\"id\":5, \"dept\": 3, \"income\":8000}, {\"id\":6, \"dept\": 2, \"income\":5000}, {\"id\":7, \"dept\": 1, \"income\":24000} ]; "); + jaql.x("employees -> group into count($);"); + jaql.x("employees -> group by d = $.dept into {d, \"total\": sum($[*].income)};"); + jaql.x("employees -> group each emp by d = emp.dept as deptEmps into {d, \"total\": sum(deptEmps[*].income)};"); + jaql.x("depts = [ {\"did\": 1, \"name\": \"development\"}, {\"did\": 2, \"name\": \"marketing\"}, {\"did\": 3, \"name\": \"sales\"} ];"); + jaql.x("group employees by g = $.dept as es, depts by g = $.did as ds into { \"dept\": g, \"deptName\": ds[0].name, \"emps\": es[*].id, \"numEmps\": count(es) };"); +end main; +[ 7 ] +[ { "d": 1, "total": 59000 }, { "d": 2, "total": 20000 }, { "d": 3, "total": 8000 } ] +[ { "d": 1, "total": 59000 }, { "d": 2, "total": 20000 }, { "d": 3, "total": 8000 } ] +[ { "dept": 1, "deptName": "development", "emps": [ 1, 2, 4, 7 ], "numEmps": 4 }, { "dept": 2, "deptName": "marketing", "emps": [ 3, 6 ], "numEmps": 2 }, { "dept": 3, "deptName": "sales", "emps": [ 5 ], "numEmps": 1 } ] + +# 11:42:27 > +# 11:42:27 > "Done." +# 11:42:27 > + _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
