Changeset: d69c979a7bd4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d69c979a7bd4
Modified Files:
        monetdb5/modules/mal/mal_weld.c
        monetdb5/modules/mal/mal_weld.h
        monetdb5/modules/mal/mal_weld.mal
        monetdb5/modules/mal/mal_weld.mal.sh
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_weld.c
Branch: mal-weld
Log Message:

weld impl for sql.projectdelta


diffs (131 lines):

diff --git a/monetdb5/modules/mal/mal_weld.c b/monetdb5/modules/mal/mal_weld.c
--- a/monetdb5/modules/mal/mal_weld.c
+++ b/monetdb5/modules/mal/mal_weld.c
@@ -388,11 +388,11 @@ WeldAlgebraProjection(Client cntxt, MalB
        (void) cntxt;
        (void) mb;
 
-       int ret = getArg(pci, 0);                                               
           /* bat[:any_1] */
-       int left = getArg(pci, 1);                                              
           /* bat[:oid] */
-       bat leftBat = *getArgReference_bat(stk, pci, 1);           /* might 
have value */
-       int right = getArg(pci, 2);                                             
           /* bat[:any_1] */
-       weldState *wstate = *getArgReference_ptr(stk, pci, 3); /* has value */
+       int ret = getArg(pci, 0);                                               
                                   /* bat[:any_1] */
+       int left = getArg(pci, 1);                                              
                                   /* bat[:oid] */
+       bat leftBat = *getArgReference_bat(stk, pci, 1);                        
           /* might have value */
+       int right = getArg(pci, 2);                                             
                                   /* bat[:any_1] */
+       weldState *wstate = *getArgReference_ptr(stk, pci, pci->argc - 1); /* 
has value */
        char weldStmt[STR_SIZE_INC];
        sprintf(weldStmt,
        "let v%d = result("
@@ -414,6 +414,13 @@ WeldAlgebraProjection(Client cntxt, MalB
 }
 
 str
+WeldSqlProjectDelta(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+       /* For tpch queries we only do project(s, c) */
+       return WeldAlgebraProjection(cntxt, mb, stk, pci);
+}
+
+str
 WeldAlgebraSelect1(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        (void) cntxt;
diff --git a/monetdb5/modules/mal/mal_weld.h b/monetdb5/modules/mal/mal_weld.h
--- a/monetdb5/modules/mal/mal_weld.h
+++ b/monetdb5/modules/mal/mal_weld.h
@@ -21,6 +21,7 @@ mal_export str WeldInitState(Client cntx
 mal_export str WeldRun(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 mal_export str WeldAggrSum(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 mal_export str WeldAlgebraProjection(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
+mal_export str WeldSqlProjectDelta(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 mal_export str WeldAlgebraSelect1(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 mal_export str WeldAlgebraSelect2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 mal_export str WeldAlgebraThetaselect1(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
diff --git a/monetdb5/modules/mal/mal_weld.mal 
b/monetdb5/modules/mal/mal_weld.mal
--- a/monetdb5/modules/mal/mal_weld.mal
+++ b/monetdb5/modules/mal/mal_weld.mal
@@ -77,6 +77,14 @@ pattern aggrsubmax(b:bat[:any_1], g:bat[
 address WeldAggrSubMax
 comment "aggr.submax";
 
+pattern sqlprojectdelta(select:bat[:oid], col:bat[:any_3], uid:bat[:oid], 
uval:bat[:any_3], wstate:ptr):bat[:any_3]
+address WeldSqlProjectDelta
+comment "sql.projectdelta";
+
+pattern sqlprojectdelta(select:bat[:oid], col:bat[:any_3], uid:bat[:oid], 
uval:bat[:any_3], ins:bat[:any_3], wstate:ptr):bat[:any_3]
+address WeldSqlProjectDelta
+comment "sql.projectdelta";
+
 pattern aggrsum(b:bat[:bte], wstate:ptr):bte
 address WeldAggrSum
 comment "aggr.sum";
diff --git a/monetdb5/modules/mal/mal_weld.mal.sh 
b/monetdb5/modules/mal/mal_weld.mal.sh
--- a/monetdb5/modules/mal/mal_weld.mal.sh
+++ b/monetdb5/modules/mal/mal_weld.mal.sh
@@ -87,6 +87,14 @@ pattern aggrsubmax(b:bat[:any_1], g:bat[
 address WeldAggrSubMax
 comment "aggr.submax";
 
+pattern sqlprojectdelta(select:bat[:oid], col:bat[:any_3], uid:bat[:oid], 
uval:bat[:any_3], wstate:ptr):bat[:any_3]
+address WeldSqlProjectDelta
+comment "sql.projectdelta";
+
+pattern sqlprojectdelta(select:bat[:oid], col:bat[:any_3], uid:bat[:oid], 
uval:bat[:any_3], ins:bat[:any_3], wstate:ptr):bat[:any_3]
+address WeldSqlProjectDelta
+comment "sql.projectdelta";
+
 EOF
 
 for tp in ${numeric[@]}; do
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -316,6 +316,7 @@ str weldInitStateRef;
 str weldLanguagePassRef;
 str weldRef;
 str weldRunRef;
+str weldSqlProjectDeltaRef;
 str wlcRef;
 str wlrRef;
 str zero_or_oneRef;
@@ -618,6 +619,7 @@ void optimizerInit(void)
        weldLanguagePassRef = putName("languagepass");
        weldRef = putName("weld");
        weldRunRef = putName("run");
+       weldSqlProjectDeltaRef = putName("sqlprojectdelta");
        wlcRef = putName("wlc");
        wlrRef = putName("wlr");
        selectRef = putName("select");
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -324,6 +324,7 @@ mal_export  str weldInitStateRef;
 mal_export  str weldLanguagePassRef;
 mal_export  str weldRef;
 mal_export  str weldRunRef;
+mal_export  str weldSqlProjectDeltaRef;
 mal_export  str wlcRef;
 mal_export  str wlrRef;
 mal_export  str zero_or_oneRef;
diff --git a/monetdb5/optimizer/opt_weld.c b/monetdb5/optimizer/opt_weld.c
--- a/monetdb5/optimizer/opt_weld.c
+++ b/monetdb5/optimizer/opt_weld.c
@@ -18,7 +18,7 @@
 #include "mal_instruction.h"
 #include "opt_weld.h"
 
-#define NUM_WELD_INSTR 16
+#define NUM_WELD_INSTR 17
 #define UNMARKED 0
 #define TEMP_MARK 1
 #define PERM_MARK 2
@@ -60,6 +60,7 @@ static void initWeldInstrs(void) {
        addWeldInstr(groupRef, subgroupRef, weldGroupRef);                      
                 /* group.subgroup */
        addWeldInstr(groupRef, groupdoneRef, weldGroupRef);                     
                 /* group.groupdone */
        addWeldInstr(groupRef, subgroupdoneRef, weldGroupRef);                  
         /* group.subgroupdone */
+       addWeldInstr(sqlRef, projectdeltaRef, weldSqlProjectDeltaRef);          
 /* sql.projectdelta */
 }
 
 static str getWeldRef(MalBlkPtr mb, InstrPtr instr) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to