Changeset: e5968740afd3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5968740afd3
Modified Files:
        MonetDB5/src/optimizer/opt_mapreduce.mx
Branch: default
Log Message:

Pass on arguments to the original function to the map function also


diffs (33 lines):

diff -r 656bdb467828 -r e5968740afd3 MonetDB5/src/optimizer/opt_mapreduce.mx
--- a/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jul 23 10:45:09 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jul 23 13:18:58 2010 +0200
@@ -257,6 +257,13 @@
                        p = pushReturn(reduce, p, v);
                        w[j] = v;
                }
+               for (j = sig->retc; j < sig->argc; j++) {
+                       /* x1 := remote.put(q, A0); */
+                       o = newStmt(reduce, remoteRef, putRef);
+                       o = pushArgument(reduce, o, q);
+                       o = pushArgument(reduce, o, getArg(sig, j));
+                       p = pushArgument(reduce, p, getArg(o, 0));
+               }
                pushInstruction(reduce, p);
 
                /* y1 := remote.get(q, x1); */
@@ -565,6 +572,15 @@
        map->keephistory = reduce->keephistory;
        pushInstruction(map, sig);
 
+       /* SQL uses canned queries, such as a WHERE a > X clause, where the
+        * X is factored out in a variable and used as argument to the
+        * original function.  We will simply copy them and pass them on to
+        * the map function. */
+       p = oreduce[0];
+       for (j = p->retc; j < p->argc; j++)
+               sig = pushArgument(map, sig, getArg(p, j));
+       map->stmt[0] = sig; /* many args realloc sig, so reset it */
+
        /* We do a two-phase scan over the original plan to get a MAP and
         * REDUCE program.  We cannot do it in a single scan, because
         * sql.bind patterns (for columns) are possibly scattered over the
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to