Changeset: cfa60eec970b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfa60eec970b
Modified Files:
        monetdb5/mal/Tests/tst1200.stable.out
        monetdb5/mal/Tests/tst1203.stable.out
        monetdb5/mal/Tests/tst1205.stable.out
        monetdb5/mal/Tests/tst901b.mal
        monetdb5/mal/Tests/tst901b.stable.out
        monetdb5/mal/Tests/tst902.mal
        monetdb5/mal/Tests/tst902.stable.out
        monetdb5/mal/Tests/tst903.stable.out
        monetdb5/mal/Tests/tst905.stable.out
        monetdb5/optimizer/opt_multiplex.c
Branch: default
Log Message:

fixing code & test for new iterator semantics; step 1: algebra.find() -> 
algebra.fetch()

Since BAT iterator now returns/uses (only) the phisycal position,
and not the (logical) head value, we can no longer use algebra.find(),
but have to use algebra.fetch(), instead.


diffs (201 lines):

diff --git a/monetdb5/mal/Tests/tst1200.stable.out 
b/monetdb5/mal/Tests/tst1200.stable.out
--- a/monetdb5/mal/Tests/tst1200.stable.out
+++ b/monetdb5/mal/Tests/tst1200.stable.out
@@ -1159,7 +1159,7 @@ exit (X_1275,X_1276);
 #      date_addyears.bat.setColumn("min100y"), 
     X_1283 := bat.new(nil:oid,nil:int);
 barrier (X_1287,X_1288) := iterator.new(date_addyears);
-    X_1290 := algebra.find(date_bat,X_1287);
+    X_1290 := algebra.fetch(date_bat,X_1287);
     X_1292 := mtime.diff(X_1288,X_1290);
     bat.insert(X_1283,X_1287,X_1292);
     redo (X_1287,X_1288) := iterator.next(date_addyears);
@@ -1175,7 +1175,7 @@ exit (X_1287,X_1288);
 #      date_addmonths.bat.setColumn("plus1m"), 
     X_1297 := bat.new(nil:oid,nil:int);
 barrier (X_1299,X_1300) := iterator.new(date_addmonths);
-    X_1302 := algebra.find(date_bat,X_1299);
+    X_1302 := algebra.fetch(date_bat,X_1299);
     X_1304 := mtime.diff(X_1300,X_1302);
     bat.insert(X_1297,X_1299,X_1304);
     redo (X_1299,X_1300) := iterator.next(date_addmonths);
@@ -1384,8 +1384,8 @@ exit (X_1418,X_1419);
 # Skipped due to coercion implication 
     X_1426 := bat.new(nil:oid,nil:timestamp);
 barrier (X_1429,X_1430) := iterator.new(date_bat);
-    X_1432 := algebra.find(daytime_bat,X_1429);
-    X_1434 := algebra.find(tzone_bat,X_1429);
+    X_1432 := algebra.fetch(daytime_bat,X_1429);
+    X_1434 := algebra.fetch(tzone_bat,X_1429);
     X_1436 := mtime.timestamp(X_1430,X_1432,X_1434);
     bat.insert(X_1426,X_1429,X_1436);
     redo (X_1429,X_1430) := iterator.next(date_bat);
@@ -1402,7 +1402,7 @@ exit (X_1429,X_1430);
 #io.print(timestamp_bat.bat.setColumn("timestamp"), 
     X_1441 := bat.new(nil:oid,nil:date);
 barrier (X_1445,X_1446) := iterator.new(timestamp_bat);
-    X_1448 := algebra.find(tzone_bat,X_1445);
+    X_1448 := algebra.fetch(tzone_bat,X_1445);
     X_1450 := mtime.date(X_1446,X_1448);
     bat.insert(X_1441,X_1445,X_1450);
     redo (X_1445,X_1446) := iterator.next(timestamp_bat);
@@ -1412,7 +1412,7 @@ exit (X_1445,X_1446);
 #      [date](timestamp_bat,tzone_bat).bat.setColumn("date"), 
     X_1455 := bat.new(nil:oid,nil:daytime);
 barrier (X_1458,X_1459) := iterator.new(timestamp_bat);
-    X_1461 := algebra.find(tzone_bat,X_1458);
+    X_1461 := algebra.fetch(tzone_bat,X_1458);
     X_1463 := mtime.daytime(X_1459,X_1461);
     bat.insert(X_1455,X_1458,X_1463);
     redo (X_1458,X_1459) := iterator.next(timestamp_bat);
@@ -1503,7 +1503,7 @@ exit (X_1525,X_1526);
 #      timestamp_minus.bat.setColumn("min1"), 
     X_1533 := bat.new(nil:oid,nil:lng);
 barrier (X_1536,X_1537) := iterator.new(timestamp_plus);
-    X_1539 := algebra.find(timestamp_minus,X_1536);
+    X_1539 := algebra.fetch(timestamp_minus,X_1536);
     X_1541 := mtime.diff(X_1537,X_1539);
     bat.insert(X_1533,X_1536,X_1541);
     redo (X_1536,X_1537) := iterator.next(timestamp_plus);
diff --git a/monetdb5/mal/Tests/tst1203.stable.out 
b/monetdb5/mal/Tests/tst1203.stable.out
--- a/monetdb5/mal/Tests/tst1203.stable.out
+++ b/monetdb5/mal/Tests/tst1203.stable.out
@@ -513,7 +513,7 @@ exit (X_419,X_420);
 #      date_addyears.bat.setColumn("min100y"), 
     X_427 := bat.new(nil:oid,nil:int);
 barrier (X_430,X_431) := iterator.new(date_addyears);
-    X_433 := algebra.find(date_bat,X_430);
+    X_433 := algebra.fetch(date_bat,X_430);
     X_435 := mtime.diff(X_431,X_433);
     bat.insert(X_427,X_430,X_435);
     redo (X_430,X_431) := iterator.next(date_addyears);
@@ -529,7 +529,7 @@ exit (X_430,X_431);
 #      date_addmonths.bat.setColumn("plus1m"), 
     X_440 := bat.new(nil:oid,nil:int);
 barrier (X_442,X_443) := iterator.new(date_addmonths);
-    X_445 := algebra.find(date_bat,X_442);
+    X_445 := algebra.fetch(date_bat,X_442);
     X_447 := mtime.diff(X_443,X_445);
     bat.insert(X_440,X_442,X_447);
     redo (X_442,X_443) := iterator.next(date_addmonths);
diff --git a/monetdb5/mal/Tests/tst1205.stable.out 
b/monetdb5/mal/Tests/tst1205.stable.out
--- a/monetdb5/mal/Tests/tst1205.stable.out
+++ b/monetdb5/mal/Tests/tst1205.stable.out
@@ -732,8 +732,8 @@ exit (X_592,X_593);
 # Skipped due to coercion implication 
     X_600 := bat.new(nil:oid,nil:timestamp);
 barrier (X_604,X_605) := iterator.new(date_bat);
-    X_607 := algebra.find(daytime_bat,X_604);
-    X_609 := algebra.find(tzone_bat,X_604);
+    X_607 := algebra.fetch(daytime_bat,X_604);
+    X_609 := algebra.fetch(tzone_bat,X_604);
     X_611 := mtime.timestamp(X_605,X_607,X_609);
     bat.insert(X_600,X_604,X_611);
     redo (X_604,X_605) := iterator.next(date_bat);
diff --git a/monetdb5/mal/Tests/tst901b.mal b/monetdb5/mal/Tests/tst901b.mal
--- a/monetdb5/mal/Tests/tst901b.mal
+++ b/monetdb5/mal/Tests/tst901b.mal
@@ -28,8 +28,8 @@ mdb.setDebug(dbgmsk_set);
 t2:= alarm.usec();
 d:= bat.new(:oid,:lng);
 barrier (h,t):= iterator.new(b);
-        zz:= algebra.find(b,h);
-        z:= algebra.find(c,h);
+        zz:= algebra.fetch(b,h);
+        z:= algebra.fetch(c,h);
        cr:= zz+z;
        bat.insert(d,h,cr);
 catch GDKerror:str;
diff --git a/monetdb5/mal/Tests/tst901b.stable.out 
b/monetdb5/mal/Tests/tst901b.stable.out
--- a/monetdb5/mal/Tests/tst901b.stable.out
+++ b/monetdb5/mal/Tests/tst901b.stable.out
@@ -73,8 +73,8 @@ exit i;
     t2 := alarm.usec();
     d := bat.new(:oid,:lng);
 barrier (h,t) := iterator.new(b);
-    zz := algebra.find(b,h);
-    z := algebra.find(c,h);
+    zz := algebra.fetch(b,h);
+    z := algebra.fetch(c,h);
     cr := calc.+(zz,z);
     bat.insert(d,h,cr);
 catch GDKerror:str ;
diff --git a/monetdb5/mal/Tests/tst902.mal b/monetdb5/mal/Tests/tst902.mal
--- a/monetdb5/mal/Tests/tst902.mal
+++ b/monetdb5/mal/Tests/tst902.mal
@@ -10,8 +10,8 @@ c:= algebra.copy(b);
 
 d:= bat.new(:oid,:lng);
 barrier (h,t):= iterator.new(b);
-       B1:= algebra.find(b,h);
-       B2:= algebra.find(c,h);
+       B1:= algebra.fetch(b,h);
+       B2:= algebra.fetch(c,h);
        t:= B1+B2;
        bat.insert(d,h,t);
        redo (h,t):= iterator.next(b);
diff --git a/monetdb5/mal/Tests/tst902.stable.out 
b/monetdb5/mal/Tests/tst902.stable.out
--- a/monetdb5/mal/Tests/tst902.stable.out
+++ b/monetdb5/mal/Tests/tst902.stable.out
@@ -46,8 +46,8 @@ exit v;
     c := algebra.copy(b);
     d := bat.new(:oid,:lng);
 barrier (h,t) := iterator.new(b);
-    B1 := algebra.find(b,h);
-    B2 := algebra.find(c,h);
+    B1 := algebra.fetch(b,h);
+    B2 := algebra.fetch(c,h);
     t := calc.+(B1,B2);
     bat.insert(d,h,t);
     redo (h,t) := iterator.next(b);
diff --git a/monetdb5/mal/Tests/tst903.stable.out 
b/monetdb5/mal/Tests/tst903.stable.out
--- a/monetdb5/mal/Tests/tst903.stable.out
+++ b/monetdb5/mal/Tests/tst903.stable.out
@@ -140,7 +140,7 @@ exit i;
     t0 := alarm.usec();
     X_98 := bat.new(nil:oid,nil:lng);
 barrier (X_102,X_103) := iterator.new(b);
-    X_105 := algebra.find(c,X_102);
+    X_105 := algebra.fetch(c,X_102);
     X_107 := calc.+(X_103,X_105);
     bat.insert(X_98,X_102,X_107);
     redo (X_102,X_103) := iterator.next(b);
diff --git a/monetdb5/mal/Tests/tst905.stable.out 
b/monetdb5/mal/Tests/tst905.stable.out
--- a/monetdb5/mal/Tests/tst905.stable.out
+++ b/monetdb5/mal/Tests/tst905.stable.out
@@ -30,7 +30,7 @@ exit i;
     c := algebra.copy(b);
     X_15 := bat.new(nil:oid,nil:lng);
 barrier (X_19,X_20) := iterator.new(b);
-    X_22 := algebra.find(c,X_19);
+    X_22 := algebra.fetch(c,X_19);
     X_24 := calc.+(X_20,X_22);
     bat.insert(X_15,X_19,X_24);
     redo (X_19,X_20) := iterator.next(b);
diff --git a/monetdb5/optimizer/opt_multiplex.c 
b/monetdb5/optimizer/opt_multiplex.c
--- a/monetdb5/optimizer/opt_multiplex.c
+++ b/monetdb5/optimizer/opt_multiplex.c
@@ -30,7 +30,7 @@
  * @verbatim
  *     resB:= bat.new(A1);
  * barrier (h,t):= iterator.new(A1);
- *     $1:= algebra.find(A1,h);
+ *     $1:= algebra.fetch(A1,h);
  *     $2:= A2;        # in case of constant?
  *     ...
  *     cr:= MOD.FCN($1,...,$n);
@@ -107,12 +107,12 @@ OPTexpandMultiplex(Client cntxt, MalBlkP
        q= pushReturn(mb, q, tvar);
        (void) pushArgument(mb,q,iter);
 
-       /* $1:= bat.find(Ai,h) or constant */
+       /* $1:= algebra.fetch(Ai,h) or constant */
        alias[i] = tvar;
 
        for (i++; i < pci->argc; i++)
                if (isaBatType(getArgType(mb, pci, i))) {
-                       q = newFcnCall(mb, algebraRef, "find");
+                       q = newFcnCall(mb, algebraRef, "fetch");
                        alias[i] = newTmpVariable(mb, 
getTailType(getArgType(mb, pci, i)));
                        getArg(q, 0) = alias[i];
                        q= pushArgument(mb, q, getArg(pci, i));
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to