Changeset: 332321deb7aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=332321deb7aa
Modified Files:
        monetdb5/extras/jaql/jaqlfunc.mal
Branch: Oct2012
Log Message:

jaql: add missing load, store and drop functions


diffs (51 lines):

diff --git a/monetdb5/extras/jaql/jaqlfunc.mal 
b/monetdb5/extras/jaql/jaqlfunc.mal
--- a/monetdb5/extras/jaql/jaqlfunc.mal
+++ b/monetdb5/extras/jaql/jaqlfunc.mal
@@ -85,6 +85,47 @@ function shred(uri:str)(kind:bat[:oid,:b
        return (r1,r2,r3,r4,r5,r6,r7);
 end shred;
 
+# (persistently) store input document
+function 
store(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str],
 
docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+       json.store(docname, kind,string,integer,double,array,object,name);
+
+       r1 := bat.new(:oid,:bte);
+       r2 := bat.new(:oid,:str);
+       r3 := bat.new(:oid,:lng);
+       r4 := bat.new(:oid,:dbl);
+       r5 := bat.new(:oid,:oid);
+       r6 := bat.new(:oid,:oid);
+       r7 := bat.new(:oid,:str);
+
+       r1 := bat.insert(r1, 0@0, 116:bte); # t
+
+       return (r1,r2,r3,r4,r5,r6,r7);
+end store
+
+# load previously stored document
+function 
load(docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+       (r1,r2,r3,r4,r5,r6,r7) := json.load(docname);
+
+       return (r1,r2,r3,r4,r5,r6,r7);
+end load;
+
+# drop a stored document
+function 
drop(docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+       json.drop(docname);
+
+       r1 := bat.new(:oid,:bte);
+       r2 := bat.new(:oid,:str);
+       r3 := bat.new(:oid,:lng);
+       r4 := bat.new(:oid,:dbl);
+       r5 := bat.new(:oid,:oid);
+       r6 := bat.new(:oid,:oid);
+       r7 := bat.new(:oid,:str);
+
+       r1 := bat.insert(r1, 0@0, 116:bte); # t
+
+       return (r1,r2,r3,r4,r5,r6,r7);
+end drop;
+
 # produce a JSON document with trace information
 function 
gettrace()(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
        r1 := bat.new(:oid,:bte);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to