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

put comments consistently under the instruction they refer to


diffs (79 lines):

diff -r 7b34ca3d1ae7 -r e2bead643b63 MonetDB5/src/optimizer/opt_mapreduce.mx
--- a/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jun 11 15:29:49 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jun 11 15:34:03 2010 +0200
@@ -720,6 +720,7 @@
                                /* simple ORDER BY */
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
+                                               pushInstruction(map, omap[i]);
                                                newComment(map, "= ORDER BY");
                                                /* fix return */
                                                lastcol->mapid = 
getArg(omap[i], 0);
@@ -734,6 +735,7 @@
                                /* simple ORDER BY DESC*/
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
+                                               pushInstruction(map, omap[i]);
                                                newComment(map, "= ORDER BY 
DESC");
                                                /* fix return */
                                                lastcol->mapid = 
getArg(omap[i], 0);
@@ -748,6 +750,7 @@
                                /* simple LIMIT/OFFSET */
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
+                                               pushInstruction(map, omap[i]);
                                                newComment(map, "= 
LIMIT/OFFSET");
                                                /* fix return */
                                                lastcol->mapid = 
getArg(omap[i], 0);
@@ -764,9 +767,9 @@
                                /* MAX aggregation */
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
-                                               newComment(map, "= MAX");
                                                /* basically perform a MAX over 
all MAXes */
                                                pushInstruction(map, omap[i]);
+                                               newComment(map, "= MAX");
                                                lastcol->mapid = 
getArg(omap[i], 0);
                                                lastcol->type = getArgType(map, 
p, 0);
                                                lastcol->reduceid = getArg(p, 
0);
@@ -779,9 +782,9 @@
                                /* MIN aggregation */
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
-                                               newComment(map, "= MIN");
                                                /* basically perform a MIN over 
all MINs */
                                                pushInstruction(map, omap[i]);
+                                               newComment(map, "= MIN");
                                                lastcol->mapid = 
getArg(omap[i], 0);
                                                lastcol->type = getArgType(map, 
p, 0);
                                                lastcol->reduceid = getArg(p, 
0);
@@ -798,8 +801,8 @@
                                                getFunctionId(oreduce[i + 1]) 
== countRef &&
                                                getArg(p, 0) == 
getArg(oreduce[i + 1], 1))
                        {
+                               pushInstruction(map, omap[i]);
                                newComment(map, "= COUNT(*)");
-                               pushInstruction(map, omap[i]);
                                copy = cNONE;
                                /* NOTE: rest is handled in case below */
                        }
@@ -815,8 +818,8 @@
                                                getArg(p, 1) = getArg(oreduce[i 
- 1], 1);
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
+                                               pushInstruction(map, omap[i]);
                                                newComment(map, "= COUNT");
-                                               pushInstruction(map, omap[i]);
                                                lastcol->mapid = 
getArg(omap[i], 0);
                                                lastcol->type = getArgType(map, 
p, 0);
                                                lastcol->reduceid = getArg(p, 
0);
@@ -828,8 +831,8 @@
                        } else if (getFunctionId(p) == sumRef) {
                                for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
                                        if (getArg(p, 1) == lastcol->reduceid) {
+                                               pushInstruction(map, omap[i]);
                                                newComment(map, "= SUM");
-                                               pushInstruction(map, omap[i]);
                                                lastcol->mapid = 
getArg(omap[i], 0);
                                                lastcol->type = getArgType(map, 
p, 0);
                                                lastcol->reduceid = getArg(p, 
0);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to