Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
In directory sc8-pr-cvs16:/tmp/cvs-serv7995

Modified Files:
        bpm.mx 
Log Message:
The partitioned BATs may be input to calculations. In this case
we need to ensure that an iterator produces correctly aligned
portions. The code hooks are prepared for this, the algorithm
needs implementation.


Index: bpm.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/bpm.mx,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- bpm.mx      20 May 2007 04:24:49 -0000      1.78
+++ bpm.mx      20 May 2007 07:51:16 -0000      1.79
@@ -83,13 +83,13 @@
        bpm.open();
        Ralias:= bpm.take("myversion",:bat[:oid,:int]);
        tu:= bat.new(:oid,:int);
-barrier (idx,Rp):= bpm.newIterator(Ralias);
+barrier Rp:= bpm.newIterator(Ralias);
        ...
        t:= algebra.select(Rp,0,100);
        tu:= algebra.union(tu,t);
        ...
-       redo (idx,Rp):= bpm.hasMoreElements(Ralias);
-exit (idx,b);
+       redo Rp:= bpm.hasMoreElements(Ralias);
+exit Rp;
        bpm.close();
 @end example
 
@@ -201,10 +201,10 @@
 reference to a partitioned BAT by an iterator.
 @example
        l:= list.new();
-barrier Elm:bat[:oid,:int]:= bpm.newIterartor(Ralias);
+barrier Elm:bat[:oid,:int]:= bpm.newIterator(Ralias);
        t:= algebra.select(Elm,0,20);
        list.append(l,t);
-       redo Elm:bat[:oid,:int]:= bpm.newIterartor(Ralias);
+       redo Elm:bat[:oid,:int]:= bpm.newIterator(Ralias);
 exit Elm;
 @end example
 Variations on this theme are iterators that search for
@@ -347,6 +347,12 @@
 Wherever possible skipping elements that don't qualify
 the bounds given for the head.
 @mal
+pattern newIterator(grp:bat[:any_1,:any_2],b:bat[:any_1,:any_3], 
c:bat[:oid,:any_4])
+       (:bat[:any_1,:any_2], :bat[:any_1,:any_3], :bat[:any_1,:any_4])
+address BPMnewIterator3;
+pattern newIterator(grp:bat[:any_1,:any_2],b:bat[:any_1,:any_3])
+       (:bat[:any_1,:any_2], :bat[:any_1,:any_2])
+address BPMnewIterator2;
 pattern newIterator(grp:bat[:any_1,:any_2]) :bat[:any_1,:any_2]
 address BPMnewIterator
 comment "Create an iterator over the BAT partitions.";
@@ -361,6 +367,12 @@
 address BPMnewIteratorRng4
 comment "Create an iterator over the BAT partitions.";
 
+pattern hasMoreElements(grp:bat[:any_1,:any_2],b:bat[:any_1,:any_3], 
c:bat[:oid,:any_4])
+       (:bat[:any_1,:any_2], :bat[:any_1,:any_3], :bat[:any_1,:any_4])
+address BPMhasMoreElements3;
+pattern hasMoreElements(grp:bat[:any_1,:any_2],b:bat[:any_1,:any_3])
+       (:bat[:any_1,:any_2], :bat[:any_1,:any_2])
+address BPMhasMoreElements2;
 pattern hasMoreElements(grp:bat[:any_1,:any_2]) :bat[:any_1,:any_2]
 address BPMhasMoreElements
 comment "Localize the next partition for processing.";
@@ -504,6 +516,8 @@
 bpm_export str BPMdiscardAll(int *ret);
 
 bpm_export str BPMnew(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
+bpm_export str BPMnewIterator2(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
+bpm_export str BPMnewIterator3(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 bpm_export str BPMnewIterator(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 bpm_export str BPMnewIteratorRng(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 bpm_export str BPMnewIteratorRng4(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
@@ -1606,6 +1620,40 @@
        BBPincref(p->nxt,TRUE);
        return MAL_SUCCEED;
 }
[EMAIL PROTECTED]
+The pair and triple iterators should more consciously
+walk thru the partition lists. At each step making
+a minimal move to ensure alignment of the iterator
+values.
[EMAIL PROTECTED]
+str
+BPMnewIterator2(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
+       (void) mb;
+       (void) stk;
+       (void) pci;
+       return MAL_SUCCEED;
+}
+str
+BPMnewIterator3(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
+       (void) mb;
+       (void) stk;
+       (void) pci;
+       return MAL_SUCCEED;
+}
+str
+BPMhasMoreElements2(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
+       (void) mb;
+       (void) stk;
+       (void) pci;
+       return MAL_SUCCEED;
+}
+str
+BPMhasMoreElements3(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
+       (void) mb;
+       (void) stk;
+       (void) pci;
+       return MAL_SUCCEED;
+}
 
 str
 BPMnewIteratorRng(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to