Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18184/compiler/mil
Modified Files:
Tag: xquery-decomposition
milprint_summer.c
Log Message:
check in unfinished code just in case...
- added a new built-in function pf:projected-put, which project a
document and serialize it on desk
- done: projection function
- todo: serialize projected document
Index: milprint_summer.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint_summer.c,v
retrieving revision 1.409.2.1
retrieving revision 1.409.2.2
diff -u -d -r1.409.2.1 -r1.409.2.2
--- milprint_summer.c 16 Feb 2008 01:02:15 -0000 1.409.2.1
+++ milprint_summer.c 20 Feb 2008 22:45:02 -0000 1.409.2.2
@@ -6739,6 +6739,49 @@
deleteResult_ (f, counter, NORMAL);
return NORMAL;
}
+ else if (!PFqname_eq(fnQname,PFqname (PFns_lib,"projected-put")))
+ {
+ /* this is a simple implementation that just serializes to file URLs */
+
+ /* translate set of used nodes */
+ rc = translate2MIL (f, NORMAL, cur_level, counter, L(args));
+ counter++;
+ saveResult_ (f, counter, NORMAL);
+
+ /* translate set of returned nodes */
+ rc = translate2MIL (f, VALUES, cur_level, counter, RL(args));
+ saveResult_(f, ++counter, NORMAL);
+
+ /* translate output filename */
+ rc = translate2MIL (f, VALUES, cur_level, counter, RRL(args));
+ if (rc == NORMAL)
+ {
+ milprintf(f, "item_str_ := item%s;\n", val_join(STR));
+ }
+
+ /* we return an empty update list here, as put is performed on-the-fly
*/
+ milprintf(f,
+ "{ # translate pf:projected-put (node()*, node()*, string) as
stmt\n"
+ /* misuse genType to pass options, e.g. debugging, timing, etc
*/
+ " fn_projected_put(genType, "
+ "item_str_.materialize(ipik)," /* filename to write */
+ "item%03u.materialize(ipik%03u), " /* used nodes */
+ "kind%03u.materialize(ipik%03u), "
+ "item%03u.materialize(ipik%03u), " /* returned nodes */
+ "kind%03u.materialize(ipik%03u), "
+ "ws, int_values, dbl_values, dec_values, str_values);\n"
+ " item := bat(void,oid).seqbase([EMAIL PROTECTED]);\n"
+ " kind := bat(void,int).seqbase([EMAIL PROTECTED]);\n"
+ " iter := [EMAIL PROTECTED];\n"
+ " pos := 1;\n"
+ " ipik := item;\n"
+ "} # end of translate pf:projected-put (node*, node*, string)
as stmt\n",
+ (counter-1), (counter-1), (counter-1), (counter-1),
+ counter, counter, counter, counter);
+ deleteResult_ (f, counter--, NORMAL);
+ deleteResult_(f, counter, NORMAL);
+ return NORMAL;
+ }
else if (!PFqname_eq(fnQname,PFqname (PFns_pf,"distinct-doc-order")))
{
translate2MIL (f, NORMAL, cur_level, counter, L(args));
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins