Changeset: 7c6c3d427207 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7c6c3d427207
Modified Files:
        monetdb5/extras/bwd/bwd.c
        monetdb5/extras/bwd/bwd.h
        monetdb5/extras/bwd/opt_bwd.mal
        monetdb5/extras/bwd/optimizer.c
Branch: bwd
Log Message:

* added output operator for approximate results


Unterschiede (56 Zeilen):

diff --git a/monetdb5/extras/bwd/bwd.c b/monetdb5/extras/bwd/bwd.c
--- a/monetdb5/extras/bwd/bwd.c
+++ b/monetdb5/extras/bwd/bwd.c
@@ -111,3 +111,8 @@ str bwdecompose(bat * res, bat * subject
 
 
 
+str
+bwd_result_column_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+       return MAL_SUCCEED;
+}
diff --git a/monetdb5/extras/bwd/bwd.h b/monetdb5/extras/bwd/bwd.h
--- a/monetdb5/extras/bwd/bwd.h
+++ b/monetdb5/extras/bwd/bwd.h
@@ -6,6 +6,8 @@
 
 extern str OPTBWD(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str deviceInfo(bat * resPlatform, bat * resDevice, bat * resDesc, bat * 
resKernels);
+str bwd_result_column_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
+
 
 #endif /* _BWD_H_ */
 
diff --git a/monetdb5/extras/bwd/opt_bwd.mal b/monetdb5/extras/bwd/opt_bwd.mal
--- a/monetdb5/extras/bwd/opt_bwd.mal
+++ b/monetdb5/extras/bwd/opt_bwd.mal
@@ -40,6 +40,10 @@ comment "Produces a BAT with fresh uniqu
                the tail that starts at base (i.e. [base,..base+b.count()-1] ) 
                and also propagates the head approximation";
 
+pattern rsColumn{unsafe}(rs:int, tname:str, name:str, typename:str, 
digits:int, scale:int, col:bat[:oid,:any_1] ) :void
+address bwd_result_column_wrap
+comment "Add the column to the approximate table query result";
+
 
 module batbwd;
 
diff --git a/monetdb5/extras/bwd/optimizer.c b/monetdb5/extras/bwd/optimizer.c
--- a/monetdb5/extras/bwd/optimizer.c
+++ b/monetdb5/extras/bwd/optimizer.c
@@ -51,6 +51,14 @@ static inline int OPTBWDImplementation(C
                                rename_function(approximationReverse, "bwd", 
markTRef, &actions, client);
                        
                }
+               if((oldProgram[i]->modname == sqlRef && oldProgram[i]->fcnname 
== rsColumnRef)){
+                       InstrPtr approximationReverse = 
copyInstruction(oldProgram[i]);
+                       /* setDestVar(approximationReverse, 
approximations[getDestVar(oldProgram[i])]); */
+                       setArg(approximationReverse, 7, 
approximations[getArg(oldProgram[i],7)]);
+                       rename_function(approximationReverse, "bwd", 
rsColumnRef, &actions, client);
+                       pushInstruction(malBlock, approximationReverse);
+                       
+               }
 
 
                ////////////////////////////// rewrite operators 
//////////////////////////////
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to