Changeset: 02c167e4ff80 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=02c167e4ff80
Modified Files:
        clients/Tests/MAL-signatures_all.stable.out
        clients/Tests/MAL-signatures_fits_geom.stable.out
        clients/Tests/MAL-signatures_geom.stable.out
        clients/Tests/MAL-signatures_none.stable.out
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_select_legacy.c
        monetdb5/ChangeLog.Oct2014
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/algebra.h
        monetdb5/modules/kernel/algebra.mal
        monetdb5/optimizer/opt_centipede.c
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_emptySet.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_pushranges.c
        monetdb5/optimizer/opt_support.c
Branch: Oct2014
Log Message:

Cleanup: removed algebra.{anti,theta}uselect, and the {,u}selectRef variables.
None of the algebra.*select functions apart from algebra.*subselect is
generated by the SQL frontend, so their implementations can be
removed.  The implementations of algebra.select and algebra.uselect
are left since they are still used internally and by MAL tests.  The
pushrange optimizer now works on subselect without candidate list, so
the optimizer tests that try it on algebra.select fail.


diffs (truncated from 710 to 300 lines):

diff --git a/clients/Tests/MAL-signatures_all.stable.out 
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -2382,14 +2382,6 @@ command algebra.antijoin(left:bat[:oid,:
 address ALGantijoin2;
 comment Returns 2 columns with all BUNs, consisting of the head-oids     from 
'left' and 'right' for which there are BUNs in 'left'      and 'right' with 
equal tails
 
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:any_1,:void]
 
-address ALGantiuselectInclusive;
-comment See select() but limited to head values
-
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],value:any_2):bat[:any_1,:void] 
-address ALGantiuselect1;
-comment Value select, but returning only the   head values. SEE 
ALSO:select(bat,val)
-
 command 
algebra.bandjoin(outer:bat[:any_1,:any_2],inner:bat[:any_2,:any_3],minus:any_2,plus:any_2,li:bit,hi:bit):bat[:any_1,:any_3]
 
 address ALGbandjoin;
 comment This is a join() for which the predicate is that two BUNs match        
        if the left-tail value is within the range [right-head - minus,         
right-head + plus], depending on (l_in/h_in), the bounds                are 
included. Works only for the builtin numerical types,               and their 
derivates.
@@ -2783,10 +2775,6 @@ command algebra.tunique(b:bat[:any_1,:an
 address ALGtunique;
 comment Select unique tuples from the input BAT. Double elimination is         
done over the BUNs tail. The result is a BAT with property              
tkeyd()== true
 
-command 
algebra.thetauselect(b:bat[:any_1,:any_2],val:any_2,op:str):bat[:any_1,:void] 
-address ALGthetauselect;
-comment The theta (<=,<,=,>,>=) select() limited to head values
-
 command 
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
 
 address ALGthetasubselect2;
 comment Select all head values of the first input BAT for which the tail value 
obeys the relation value OP VAL and for which the head value occurs in  the 
tail of the second input BAT.       Input is a dense-headed BAT, output is a 
dense-headed BAT with in       the tail the head value of the input BAT for 
which the  relationship holds.  The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out 
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -2383,14 +2383,6 @@ command algebra.antijoin(left:bat[:oid,:
 address ALGantijoin2;
 comment Returns 2 columns with all BUNs, consisting of the head-oids     from 
'left' and 'right' for which there are BUNs in 'left'      and 'right' with 
equal tails
 
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:any_1,:void]
 
-address ALGantiuselectInclusive;
-comment See select() but limited to head values
-
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],value:any_2):bat[:any_1,:void] 
-address ALGantiuselect1;
-comment Value select, but returning only the   head values. SEE 
ALSO:select(bat,val)
-
 command 
algebra.bandjoin(outer:bat[:any_1,:any_2],inner:bat[:any_2,:any_3],minus:any_2,plus:any_2,li:bit,hi:bit):bat[:any_1,:any_3]
 
 address ALGbandjoin;
 comment This is a join() for which the predicate is that two BUNs match        
        if the left-tail value is within the range [right-head - minus,         
        right-head + plus], depending on (l_in/h_in), the bounds                
are included. Works only for the builtin numerical types,               and 
their derivates.
@@ -2784,10 +2776,6 @@ command algebra.tunique(b:bat[:any_1,:an
 address ALGtunique;
 comment Select unique tuples from the input BAT. Double elimination is         
        done over the BUNs tail. The result is a BAT with property              
tkeyd()== true
 
-command 
algebra.thetauselect(b:bat[:any_1,:any_2],val:any_2,op:str):bat[:any_1,:void] 
-address ALGthetauselect;
-comment The theta (<=,<,=,>,>=) select() limited to head values
-
 command 
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
 
 address ALGthetasubselect2;
 comment Select all head values of the first input BAT for which the tail value 
obeys the relation value OP VAL and for which the head value occurs in  the 
tail of the second input BAT.       Input is a dense-headed BAT, output is a 
dense-headed BAT with in       the tail the head value of the input BAT for 
which the  relationship holds.  The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_geom.stable.out 
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -2383,14 +2383,6 @@ command algebra.antijoin(left:bat[:oid,:
 address ALGantijoin2;
 comment Returns 2 columns with all BUNs, consisting of the head-oids     from 
'left' and 'right' for which there are BUNs in 'left'      and 'right' with 
equal tails
 
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:any_1,:void]
 
-address ALGantiuselectInclusive;
-comment See select() but limited to head values
-
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],value:any_2):bat[:any_1,:void] 
-address ALGantiuselect1;
-comment Value select, but returning only the   head values. SEE 
ALSO:select(bat,val)
-
 command 
algebra.bandjoin(outer:bat[:any_1,:any_2],inner:bat[:any_2,:any_3],minus:any_2,plus:any_2,li:bit,hi:bit):bat[:any_1,:any_3]
 
 address ALGbandjoin;
 comment This is a join() for which the predicate is that two BUNs match        
        if the left-tail value is within the range [right-head - minus,         
        right-head + plus], depending on (l_in/h_in), the bounds                
are included. Works only for the builtin numerical types,               and 
their derivates.
@@ -2784,10 +2776,6 @@ command algebra.tunique(b:bat[:any_1,:an
 address ALGtunique;
 comment Select unique tuples from the input BAT. Double elimination is         
        done over the BUNs tail. The result is a BAT with property              
tkeyd()== true
 
-command 
algebra.thetauselect(b:bat[:any_1,:any_2],val:any_2,op:str):bat[:any_1,:void] 
-address ALGthetauselect;
-comment The theta (<=,<,=,>,>=) select() limited to head values
-
 command 
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
 
 address ALGthetasubselect2;
 comment Select all head values of the first input BAT for which the tail value 
obeys the relation value OP VAL and for which the head value occurs in  the 
tail of the second input BAT.       Input is a dense-headed BAT, output is a 
dense-headed BAT with in       the tail the head value of the input BAT for 
which the  relationship holds.  The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_none.stable.out 
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -2382,14 +2382,6 @@ command algebra.antijoin(left:bat[:oid,:
 address ALGantijoin2;
 comment Returns 2 columns with all BUNs, consisting of the head-oids     from 
'left' and 'right' for which there are BUNs in 'left'      and 'right' with 
equal tails
 
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:any_1,:void]
 
-address ALGantiuselectInclusive;
-comment See select() but limited to head values
-
-command 
algebra.antiuselect(b:bat[:any_1,:any_2],value:any_2):bat[:any_1,:void] 
-address ALGantiuselect1;
-comment Value select, but returning only the   head values. SEE 
ALSO:select(bat,val)
-
 command 
algebra.bandjoin(outer:bat[:any_1,:any_2],inner:bat[:any_2,:any_3],minus:any_2,plus:any_2,li:bit,hi:bit):bat[:any_1,:any_3]
 
 address ALGbandjoin;
 comment This is a join() for which the predicate is that two BUNs match        
        if the left-tail value is within the range [right-head - minus,         
right-head + plus], depending on (l_in/h_in), the bounds                are 
included. Works only for the builtin numerical types,               and their 
derivates.
@@ -2783,10 +2775,6 @@ command algebra.tunique(b:bat[:any_1,:an
 address ALGtunique;
 comment Select unique tuples from the input BAT. Double elimination is         
done over the BUNs tail. The result is a BAT with property              
tkeyd()== true
 
-command 
algebra.thetauselect(b:bat[:any_1,:any_2],val:any_2,op:str):bat[:any_1,:void] 
-address ALGthetauselect;
-comment The theta (<=,<,=,>,>=) select() limited to head values
-
 command 
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
 
 address ALGthetasubselect2;
 comment Select all head values of the first input BAT for which the tail value 
obeys the relation value OP VAL and for which the head value occurs in  the 
tail of the second input BAT.       Input is a dense-headed BAT, output is a 
dense-headed BAT with in       the tail the head value of the input BAT for 
which the  relationship holds.  The output BAT is sorted on the tail value.
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -20,7 +20,6 @@ ptr ATOMnil(int id);
 int ATOMprint(int id, const void *val, stream *fd);
 BAT *BATalpha(BAT *b);
 BAT *BATantijoin(BAT *l, BAT *r);
-BAT *BATantiuselect_(BAT *b, const void *tl, const void *th, bit li, bit hi);
 BAT *BATappend(BAT *b, BAT *c, bit force);
 void BATassertProps(BAT *b);
 atomDesc BATatoms[];
@@ -723,8 +722,6 @@ str ALARMtimers(int *res);
 str ALARMusec(lng *ret);
 str ALGantijoin(int *result, int *lid, int *rid);
 str ALGantijoin2(int *l, int *r, int *lid, int *rid);
-str ALGantiuselect1(int *result, int *bid, ptr value);
-str ALGantiuselectInclusive(int *result, int *bid, ptr low, ptr high, bit 
*lin, bit *rin);
 str ALGavg(dbl *res, int *bid);
 str ALGbandjoin(int *result, int *lid, int *rid, const void *minus, const void 
*plus, bit *li, bit *hi);
 str ALGbandjoin2(int *l, int *r, int *lid, int *rid, const void *minus, const 
void *plus, bit *li, bit *hi);
@@ -814,10 +811,8 @@ str ALGtdifference(int *result, int *lid
 str ALGthetajoin(int *result, int *lid, int *rid, int *opc);
 str ALGthetajoin2(int *l, int *r, int *lid, int *rid, int *opc);
 str ALGthetajoinEstimate(int *result, int *lid, int *rid, int *opc, lng 
*estimate);
-str ALGthetaselect(int *result, int *bid, ptr low, str *op);
 str ALGthetasubselect1(bat *result, bat *bid, const void *val, const char 
**op);
 str ALGthetasubselect2(bat *result, bat *bid, bat *sid, const void *val, const 
char **op);
-str ALGthetauselect(int *result, int *bid, ptr value, str *op);
 str ALGthsort(int *result, int *lid);
 str ALGtinter(int *result, int *lid, int *rid);
 str ALGtintersect(int *result, int *lid, int *rid);
@@ -2116,7 +2111,6 @@ str alarmRef;
 str algebraRef;
 int allTargetsVisible(MalBlkPtr mb, Lifespan span, int pc, int qc);
 str antijoinRef;
-str antiuselectRef;
 str appendRef;
 str appendidxRef;
 str arrayRef;
@@ -2666,7 +2660,6 @@ str safeguardStack(Client cntxt, MalBlkP
 int safetyBarrier(InstrPtr p, InstrPtr q);
 str schedulerRef;
 str selectNotNilRef;
-str selectRef;
 str semaRef;
 str semijoinPathRef;
 str semijoinRef;
@@ -2761,9 +2754,7 @@ str takeRef;
 str tdiffRef;
 str tdifferenceRef;
 str thetajoinRef;
-str thetaselectRef;
 str thetasubselectRef;
-str thetauselectRef;
 str tidRef;
 str timestampRef;
 int timestamp_fromstr(const char *buf, int *len, timestamp **ret);
@@ -2793,7 +2784,6 @@ void updateFootPrint(MalBlkPtr mb, MalSt
 str updateRef;
 void updateScenario(str scen, str nme, MALfcn fcn);
 int updatesProp;
-str uselectRef;
 str userRef;
 VarPtr varGetProp(MalBlkPtr mb, int var, int prop);
 str varGetPropStr(MalBlkPtr mb, int var);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3272,7 +3272,6 @@ gdk_export BAT *BATsubselect(BAT *b, BAT
 gdk_export BAT *BATthetasubselect(BAT *b, BAT *s, const void *val, const char 
*op);
 gdk_export BAT *BATselect_(BAT *b, const void *tl, const void *th, bit li, bit 
hi);
 gdk_export BAT *BATuselect_(BAT *b, const void *tl, const void *th, bit li, 
bit hi);
-gdk_export BAT *BATantiuselect_(BAT *b, const void *tl, const void *th, bit 
li, bit hi);
 gdk_export BAT *BATselect(BAT *b, const void *tl, const void *th);
 gdk_export BAT *BATuselect(BAT *b, const void *tl, const void *th);
 
@@ -3426,16 +3425,6 @@ gdk_export BAT *BATsample(BAT *b, BUN n)
                BATuselect_(_b, (h), (t), (li), (hi));                  \
        })
 
-#define BATantiuselect_(b, h, t, li, hi)                               \
-       ({                                                              \
-               BAT *_b = (b);                                          \
-               HEADLESSDEBUG fprintf(stderr,                           \
-                       "#BATantiuselect_([%s,%s]#"BUNFMT") %s[%s:%d]\n", \
-                       _COL_TYPE(_b->H), _COL_TYPE(_b->T), BATcount(_b), \
-                       __func__, __FILE__, __LINE__);                  \
-               BATantiuselect_(_b, (h), (t), (li), (hi));              \
-       })
-
 #define BATselect(b, h, t)                                             \
        ({                                                              \
                BAT *_b = (b);                                          \
diff --git a/gdk/gdk_select_legacy.c b/gdk/gdk_select_legacy.c
--- a/gdk/gdk_select_legacy.c
+++ b/gdk/gdk_select_legacy.c
@@ -25,7 +25,6 @@
 
 #undef BATselect_
 #undef BATuselect_
-#undef BATantiuselect_
 #undef BATselect
 #undef BATuselect
 
@@ -162,12 +161,6 @@ BATuselect_(BAT *b, const void *h, const
        return BAT_select_(b, h, t, li, hi, FALSE, FALSE, "BATuselect_");
 }
 
-BAT *
-BATantiuselect_(BAT *b, const void *h, const void *t, bit li, bit hi)
-{
-       return BAT_select_(b, h, t, li, hi, FALSE, TRUE, "BATantiuselect");
-}
-
 /* Return a BAT which is a subset of b with just the qualifying
  * tuples. */
 BAT *
diff --git a/monetdb5/ChangeLog.Oct2014 b/monetdb5/ChangeLog.Oct2014
--- a/monetdb5/ChangeLog.Oct2014
+++ b/monetdb5/ChangeLog.Oct2014
@@ -1,6 +1,10 @@
 # ChangeLog file for MonetDB5
 # This file is updated with Maddlog
 
+* Tue Aug 26 2014 Sjoerd Mullender <[email protected]>
+- Remove algebra.antiuselect and algebra.thetauselect.  They were subsumed
+  by algebra.subselect.
+
 * Mon Aug 25 2014 Sjoerd Mullender <[email protected]>
 - Removed algebra.topN and its imlementation BATtopN.  The function was
   not used.
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -98,23 +98,6 @@ CMDuselect_(BAT **result, BAT *b, ptr lo
 }
 
 static int
-CMDantiuselect_(BAT **result, BAT *b, ptr low, ptr high, bit *l_in, bit *h_in)
-{
-       int tt = b->ttype;
-       ptr nil = ATOMnilptr(tt);
-
-       if (*l_in == bit_nil && ATOMcmp(tt, low, nil)) {
-               GDKerror("CMDantiuselect: flag 'l_in' must not be NIL, unless 
boundary 'low' is NIL\n");
-               return GDK_FAIL;
-       }
-       if (*h_in == bit_nil && ATOMcmp(tt, high, nil)) {
-               GDKerror("CMDantiuselect: flag 'h_in' must not be NIL, unless 
boundary 'high' is NIL\n");
-               return GDK_FAIL;
-       }
-       return (*result = BATantiuselect_(b, low, high, *l_in, *h_in)) ? 
GDK_SUCCEED : GDK_FAIL;
-}
-
-static int
 CMDgen_group(BAT **result, BAT *gids, BAT *cnts )
 {
        wrd j, gcnt = BATcount(gids);
@@ -377,11 +360,11 @@ ALGsubselect2(bat *result, bat *bid, bat
                throw(MAL, "algebra.subselect", ILLEGAL_ARGUMENT);
        }
        if ((b = BATdescriptor(*bid)) == NULL) {
-               throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
+               throw(MAL, "algebra.subselect", RUNTIME_OBJECT_MISSING);
        }
        if (sid && *sid && (s = BATdescriptor(*sid)) == NULL) {
                BBPreleaseref(b->batCacheid);
-               throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
+               throw(MAL, "algebra.subselect", RUNTIME_OBJECT_MISSING);
        }
        derefStr(b, t, low);
        derefStr(b, t, high);
@@ -415,11 +398,11 @@ ALGthetasubselect2(bat *result, bat *bid
        BAT *b, *s = NULL, *bn;
 
        if ((b = BATdescriptor(*bid)) == NULL) {
-               throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
+               throw(MAL, "algebra.thetasubselect", RUNTIME_OBJECT_MISSING);
        }
        if (sid && *sid && (s = BATdescriptor(*sid)) == NULL) {
                BBPreleaseref(b->batCacheid);
-               throw(MAL, "algebra.select", RUNTIME_OBJECT_MISSING);
+               throw(MAL, "algebra.thetasubselect", RUNTIME_OBJECT_MISSING);
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to