Changeset: ef56c2dc61d7 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ef56c2dc61d7 Modified Files: MonetDB5/src/optimizer/opt_mapreduce.mx Branch: default Log Message:
drop ugly pointer hack that caused too much problems in further code, replaced
with a less ugly hack, makes select count(col) ... work
diffs (56 lines):
diff -r c4d59d20607f -r ef56c2dc61d7 MonetDB5/src/optimizer/opt_mapreduce.mx
--- a/MonetDB5/src/optimizer/opt_mapreduce.mx Wed Jun 09 13:56:30 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mapreduce.mx Wed Jun 09 14:19:44 2010 +0200
@@ -454,6 +454,7 @@
struct stack tracker = { NULL, 0, 0 };
struct stack avgtrack = { NULL, 0, 0 };
char hadBinds = 0;
+ str mapreduceRef = putName("mapreduce", 9);
(void)stk; /* useless, is NULL */
(void)pc;
@@ -563,27 +564,21 @@
/* this is a column
reference, keep it */
if (lastcol == NULL) {
col = lastcol =
alloca(sizeof(mapcol));
- lastcol->mapid
= getArg(p, 0);
-
lastcol->reduceid = getArg(oreduce[i], 0);
- lastcol->type =
getArgType(map, p, 0);
- lastcol->mapbat
= -1;
- lastcol->next =
NULL;
/* this is the
first one, leave a marker */
-
freeInstruction(oreduce[i]);
- /* FIXME:
should leave some symbol */
- oreduce[i] =
(InstrPtr)1;
+
oreduce[i]->token = REMsymbol;
+
setModuleId(oreduce[i], mapreduceRef);
pushInstruction(map, p);
copy = LEAVE;
} else {
lastcol =
lastcol->next =
alloca(sizeof(mapcol));
- lastcol->mapid
= getArg(p, 0);
-
lastcol->reduceid = getArg(oreduce[i], 0);
- lastcol->type =
getArgType(map, p, 0);
- lastcol->mapbat
= -1;
- lastcol->next =
NULL;
copy = SINGLE;
}
+ lastcol->mapid =
getArg(p, 0);
+ lastcol->reduceid =
getArg(oreduce[i], 0);
+ lastcol->type =
getArgType(map, p, 0);
+ lastcol->mapbat = -1;
+ lastcol->next = NULL;
newComment(map, "= sql
column bat");
@:dealWithAVG@
@@ -648,7 +643,8 @@
for (i = 0; i < limit; i++) { /* phase 2 */
p = oreduce[i];
- if (p == (InstrPtr)1) {
+ /* placeholder for MRdistributework */
+ if (p->token == REMsymbol && getModuleId(p) == mapreduceRef) {
trackstack_push(&tracker, -1);
continue;
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list
