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

* actually using the lng-version of the sum properly


Unterschiede (49 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
@@ -9,6 +9,9 @@
 
 #include "sql_mvc.h"
 
+extern str getSQLContext(Client cntxt, MalBlkPtr mb, mvc **c, void **b);
+
+
 #include "sql.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
@@ -213,10 +213,18 @@ command sumapproximate (b:bat[:oid,:int]
 address BWDGroupedSumApproximate
 comment "Approximates the grouped sum of all tail values.";
 
+command sumapproximate (b:bat[:oid,:int], g:bat[:oid,:oid],e:bat[:oid,:any_1]) 
:bat[:oid,:lng]
+address BWDGroupedSumApproximate
+comment "Approximates the grouped sum of all tail values.";
+
 command sumrefine (b:bat[:oid,:int], g:bat[:oid,:oid],e:bat[:oid,:any_1], 
approximation:bat[:oid,:int]) :bat[:oid,:int]
 address BWDGroupedSumRefine
 comment "Refines the grouped sum of all tail values.";
 
+command sumrefine (b:bat[:oid,:int], g:bat[:oid,:oid],e:bat[:oid,:any_1], 
approximation:bat[:oid,:lng]) :bat[:oid,:lng]
+address BWDGroupedSumRefine
+comment "Refines the grouped sum of all tail values.";
+
 command countapproximate (b:bat[:oid,:any_2], 
g:bat[:oid,:oid],e:bat[:oid,:any_1]) :bat[:oid,:int]
 address BWDGroupedCountApproximate
 comment "Approximates the grouped count of all tail values.";
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
@@ -94,8 +94,8 @@ static inline int OPTBWDImplementation(C
                         || match_function(oldProgram[i], algebraRef, 
leftjoinRef)) {
                ////////////////////////////// rewrite operators 
//////////////////////////////
 
-                       if (getTailType(getDestType(malBlock, oldProgram[i])) 
== TYPE_lng
-                                       || getTailType(getDestType(malBlock, 
oldProgram[i])) == TYPE_wrd){ //TODO: implement bwd for longs
+                       if ((getTailType(getDestType(malBlock, oldProgram[i])) 
== TYPE_lng
+                                        || getTailType(getDestType(malBlock, 
oldProgram[i])) == TYPE_wrd) && !match_function(oldProgram[i], aggrRef, 
sumRef)){ //TODO: implement bwd for longs
                                if(isaBatType(getDestType(malBlock, 
oldProgram[i])))
                                        setDestType(malBlock, oldProgram[i], 
newBatType(getHeadType(getDestType(malBlock, oldProgram[i])), TYPE_int));
                                else{
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to