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

Fix count/sum detection, by putting it outside of unreachable code :(


diffs (51 lines):

diff -r 28b78761e56d -r 22d72d45a13a MonetDB5/src/optimizer/opt_mapreduce.mx
--- a/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jul 23 16:42:07 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mapreduce.mx   Fri Jul 23 17:02:10 2010 +0200
@@ -870,19 +870,6 @@
                                        }
                                }
                        }
-               } else if (getModuleId(p) == batRef && getFunctionId(p) == 
mirrorRef) {
-                       /* prepare for a count(*) where the aggr.count has a 
leading
-                        * bat.mirror */
-                       if (getModuleId(oreduce[i + 1]) == aggrRef &&
-                                               getFunctionId(oreduce[i + 1]) 
== countRef &&
-                                               getArg(p, 0) == 
getArg(oreduce[i + 1], 1))
-                       {
-                               pushInstruction(map, omap[i]);
-                               newComment(map, "= COUNT(*)");
-                               copy = cNONE;
-                               /* NOTE: rest is handled in case below */
-                       }
-               } else if (getModuleId(p) == aggrRef) {
                        /* COUNT/SUM push down, replace with SUM in REDUCE 
program,
                         * fix up the return type */
                        if (getFunctionId(p) == countRef) {
@@ -905,7 +892,7 @@
                                        }
                                }
                        } else if (getFunctionId(p) == sumRef) {
-                               for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) { 
+                               for (lastcol = col; lastcol != NULL; lastcol = 
lastcol->next) {
                                        if (getArg(p, 1) == lastcol->reduceid) {
                                                pushInstruction(map, omap[i]);
                                                newComment(map, "= SUM");
@@ -918,6 +905,18 @@
                                        }
                                }
                        }
+               } else if (getModuleId(p) == batRef && getFunctionId(p) == 
mirrorRef) {
+                       /* prepare for a count(*) where the aggr.count has a 
leading
+                        * bat.mirror */
+                       if (getModuleId(oreduce[i + 1]) == aggrRef &&
+                                               getFunctionId(oreduce[i + 1]) 
== countRef &&
+                                               getArg(p, 0) == 
getArg(oreduce[i + 1], 1))
+                       {
+                               pushInstruction(map, omap[i]);
+                               newComment(map, "= COUNT(*)");
+                               copy = cNONE;
+                               /* NOTE: rest is handled in case below */
+                       }
                }
 
                /* terminate both map and reduce functions properly */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to