Changeset: ae7958b81646 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae7958b81646
Modified Files:
        monetdb5/extras/jaql/jaql.mal
        monetdb5/extras/jaql/jaqlgencode.c
Branch: Oct2012
Log Message:

jaql.{,u}select: remove

Since Sjoerd's changes, algebra.{,u}select are guaranteed to return
matches in input order, which is exactly what jaql.{,u}select
guaranteed.  Hence remove no longer needed costly work.


diffs (200 lines):

diff --git a/monetdb5/extras/jaql/jaql.mal b/monetdb5/extras/jaql/jaql.mal
--- a/monetdb5/extras/jaql/jaql.mal
+++ b/monetdb5/extras/jaql/jaql.mal
@@ -37,22 +37,6 @@ pattern cast(b:bat[:oid,:any], t:any_1):
 address JAQLcast
 comment "Return BAT b as BAT with tail type of t, if the BAT tail in reality 
is of that type";
 
-# select wrappers that preserve order
-function select(b:bat[:oid,:any_1], v:any_1):bat[:oid,:any_1];
-       j := algebra.markT(b, 0@0);
-       a := algebra.markH(b, 0@0);
-       q := algebra.select(a, v);
-       l := algebra.leftjoin(j, q);
-       return l;
-end select
-function uselect(b:bat[:oid,:any_1], v:any_1):bat[:oid,:void];
-       l := algebra.markT(b, 0@0);
-       r := algebra.markH(b, 0@0);
-       e := algebra.uselect(r, v);
-       s := algebra.leftjoin(l, e);
-       return s;
-end uselect
-
 # scenario functions and init call
 command prelude()
 address JAQLprelude;
diff --git a/monetdb5/extras/jaql/jaqlgencode.c 
b/monetdb5/extras/jaql/jaqlgencode.c
--- a/monetdb5/extras/jaql/jaqlgencode.c
+++ b/monetdb5/extras/jaql/jaqlgencode.c
@@ -159,7 +159,7 @@ dumparrrefvar(MalBlkPtr mb, tree *t, int
 
        /* array indirection, entries must be arrays */
        q = newInstruction(mb, ASSIGNsymbol);
-       setModuleId(q, putName("jaql", 4));
+       setModuleId(q, algebraRef);
        setFunctionId(q, uselectRef);
        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
        q = pushArgument(mb, q, elems);
@@ -270,7 +270,7 @@ dumparrrefvar(MalBlkPtr mb, tree *t, int
                pushInstruction(mb, q);
 
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, b);
@@ -370,7 +370,7 @@ dumprefvar(jc *j, MalBlkPtr mb, tree *t,
                } else {
                        MALCOMMENT(mb, "| dereferencing %s", t->sval);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, a);
@@ -416,7 +416,7 @@ dumprefvar(jc *j, MalBlkPtr mb, tree *t,
                        a = getArg(q, 0);
                        pushInstruction(mb, q);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, a);
@@ -1082,7 +1082,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                        b = getArg(q, 0);
                        pushInstruction(mb, q);
                        q = newInstruction(mb, ASSIGNsymbol);
-                       setModuleId(q, putName("jaql", 4));
+                       setModuleId(q, algebraRef);
                        setFunctionId(q, uselectRef);
                        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                        q = pushArgument(mb, q, b);
@@ -1102,7 +1102,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                switch (t->tval2->cval) {
                        case j_equals:
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -1112,7 +1112,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                                break;
                        case j_nequal:
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -1257,7 +1257,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                /* booleans can only be compared with j_equals and
                 * j_nequal */
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, c);
@@ -1265,7 +1265,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                e = getArg(q, 0);
                pushInstruction(mb, q);
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, c);
@@ -1282,7 +1282,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                pushInstruction(mb, q);
 
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, d);
@@ -1290,7 +1290,7 @@ dumpcomp(jc *j, Client cntxt, MalBlkPtr 
                e = getArg(q, 0);
                pushInstruction(mb, q);
                q = newInstruction(mb, ASSIGNsymbol);
-               setModuleId(q, putName("jaql", 4));
+               setModuleId(q, algebraRef);
                setFunctionId(q, selectRef);
                q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                q = pushArgument(mb, q, d);
@@ -2385,7 +2385,7 @@ dumppredjoin(jc *j, MalBlkPtr mb, json_v
                                l = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, selectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, l);
@@ -3489,7 +3489,7 @@ dumpvariabletransformation(jc *j, Client
                                c = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, c);
@@ -4184,7 +4184,7 @@ dumpvariabletransformation(jc *j, Client
                                                                b = getArg(q, 
0);
                                                                
pushInstruction(mb, q);
                                                                q = 
newInstruction(mb, ASSIGNsymbol);
-                                                               setModuleId(q, 
putName("jaql", 4));
+                                                               setModuleId(q, 
algebraRef);
                                                                
setFunctionId(q, selectRef);
                                                                q = 
pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                                                                q = 
pushArgument(mb, q, b);
@@ -4192,7 +4192,7 @@ dumpvariabletransformation(jc *j, Client
                                                                c = getArg(q, 
0);
                                                                
pushInstruction(mb, q);
                                                                q = 
newInstruction(mb, ASSIGNsymbol);
-                                                               setModuleId(q, 
putName("jaql", 4));
+                                                               setModuleId(q, 
algebraRef);
                                                                
setFunctionId(q, selectRef);
                                                                q = 
pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
                                                                q = 
pushArgument(mb, q, b);
@@ -4790,7 +4790,7 @@ dumpvalsfromarr(MalBlkPtr mb, enum treet
        a = dumpwalkvar(mb, j1, j5);
 
        q = newInstruction(mb, ASSIGNsymbol);
-       setModuleId(q, putName("jaql", 4));
+       setModuleId(q, algebraRef);
        setFunctionId(q, selectRef);
        q = pushReturn(mb, q, newTmpVariable(mb, TYPE_any));
        q = pushArgument(mb, q, a);
@@ -5472,7 +5472,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                pushInstruction(mb, q);
 
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, uselectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, a);
@@ -5562,7 +5562,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                b = getArg(q, 0);
                                pushInstruction(mb, q);
                                q = newInstruction(mb, ASSIGNsymbol);
-                               setModuleId(q, putName("jaql", 4));
+                               setModuleId(q, algebraRef);
                                setFunctionId(q, selectRef);
                                q = pushReturn(mb, q, newTmpVariable(mb, 
TYPE_any));
                                q = pushArgument(mb, q, b);
@@ -6294,7 +6294,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
                                        f = getArg(q, 0);
                                        pushInstruction(mb, q);
                                        q = newInstruction(mb, ASSIGNsymbol);
-                                       setModuleId(q, putName("jaql", 4));
+                                       setModuleId(q, algebraRef);
                                        setFunctionId(q, uselectRef);
                                        q = pushReturn(mb, q, 
newTmpVariable(mb, TYPE_any));
                                        q = pushArgument(mb, q, e);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to