Changeset: 7577be5e7592 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7577be5e7592
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_private.h
        monetdb5/ChangeLog
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/algebra.mal
        monetdb5/optimizer/opt_mergetable.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_pushselect.c
Branch: default
Log Message:

Removed algebra.tdiff and algebra.tinter, made BATkdiff into gdk private 
function.


diffs (282 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -2499,14 +2499,6 @@ command algebra.subselect(b:bat[:oid,:an
 address ALGsubselect1;
 comment Select all head values for which the tail value is in range.   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 tail value       is between the 
values low and high (inclusive if li respectively        hi is set).  The 
output BAT is sorted on the tail value.  If low        or high is nil, the 
boundary is not considered (effectively - and       + infinity).  If anti is 
set, the result is the complement.  Nil        values in the tail are never 
matched, unless low=nil, high=nil, li=1, hi=1, anti=0.  All non-nil values are 
returned if low=nil,        high=nil, and li, hi are not both 1, or anti=1. 
Note that the output is suitable as second input for the other  version of this 
function.
 
-command algebra.tdiff(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 
-address ALGtdiff;
-comment Deprecated, see algebra.subdiff
-
-command 
algebra.tinter(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 
-address ALGtinter;
-comment Deprecated, see algebra.semijoin
-
 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.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -3010,14 +3010,6 @@ command algebra.subselect(b:bat[:oid,:an
 address ALGsubselect1;
 comment Select all head values for which the tail value is in range.   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 tail value       is between the 
values low and high (inclusive if li respectively        hi is set).  The 
output BAT is sorted on the tail value.  If low        or high is nil, the 
boundary is not considered (effectively - and       + infinity).  If anti is 
set, the result is the complement.  Nil        values in the tail are never 
matched, unless low=nil, high=nil, li=1, hi=1, anti=0.  All non-nil values are 
returned if low=nil,        high=nil, and li, hi are not both 1, or anti=1. 
Note that the output is suitable as second input for the other  version of this 
function.
 
-command algebra.tdiff(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 
-address ALGtdiff;
-comment Deprecated, see algebra.subdiff
-
-command 
algebra.tinter(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 
-address ALGtinter;
-comment Deprecated, see algebra.semijoin
-
 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
@@ -138,7 +138,6 @@ gdk_return BATimprints(BAT *b);
 gdk_return BATins(BAT *b, BAT *c, bit force);
 BAT *BATintersectcand(BAT *a, BAT *b);
 BAT *BATjoin(BAT *l, BAT *r, BUN estimate);
-BAT *BATkdiff(BAT *b, BAT *c);
 gdk_return BATkey(BAT *b, int onoff);
 BAT *BATleftjoin(BAT *l, BAT *r, BUN estimate);
 BAT *BATmark(BAT *b, oid base);
@@ -2608,7 +2607,6 @@ str sumRef;
 int tableProp;
 str takeOid(oid id, str *val);
 str takeRef;
-str tdiffRef;
 str thetajoinRef;
 str thetasubselectRef;
 str tidRef;
@@ -2618,7 +2616,6 @@ timestamp *timestamp_nil;
 int timestamp_tostr(str *buf, int *len, const timestamp *val);
 int timestamp_tz_fromstr(const char *buf, int *len, timestamp **ret);
 int timestamp_tz_tostr(str *buf, int *len, const timestamp *val, const tzone 
*timezone);
-str tinterRef;
 int tlbProp;
 int toriginProp;
 void trimMalBlk(MalBlkPtr mb);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3137,8 +3137,6 @@ gdk_export BAT *BATslice(BAT *b, BUN low
 
 gdk_export BAT *BATsubunique(BAT *b, BAT *s);
 
-gdk_export BAT *BATkdiff(BAT *b, BAT *c);
-
 gdk_export BAT *BATmergecand(BAT *a, BAT *b);
 gdk_export BAT *BATintersectcand(BAT *a, BAT *b);
 
@@ -3227,17 +3225,6 @@ gdk_export BAT *BATsample(BAT *b, BUN n)
                BATleftjoin(_l, _r, (estimate));                        \
        })
 
-#define BATkdiff(l, r)                                                 \
-       ({                                                              \
-               BAT *_l = (l), *_r = (r);                               \
-               HEADLESSDEBUG fprintf(stderr,                           \
-                       "#BATkdiff([%s,%s]#"BUNFMT",[%s,%s]#"BUNFMT") 
%s[%s:%d]\n", \
-                       _COL_TYPE(_l->H), _COL_TYPE(_l->T), BATcount(_l), \
-                       _COL_TYPE(_r->H), _COL_TYPE(_r->T), BATcount(_r), \
-                       __func__, __FILE__, __LINE__);                  \
-               BATkdiff(_l, _r);                                       \
-       })
-
 #endif
 #endif
 
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -67,6 +67,8 @@ struct BATstore {
        __attribute__((__visibility__("hidden")));
 __hidden void BATinit_idents(BAT *bn)
        __attribute__((__visibility__("hidden")));
+__hidden BAT *BATkdiff(BAT *b, BAT *c)
+       __attribute__((__visibility__("hidden")));
 __hidden BAT *BATload_intern(bat bid, int lock)
        __attribute__((__visibility__("hidden")));
 __hidden gdk_return BATmaterialize(BAT *b)
@@ -436,6 +438,17 @@ GDKreallocmax_debug(void *ptr, size_t si
 #ifdef __GNUC__
 /* in debug builds, complain (warn) about usage of legacy functions */
 
+#define BATkdiff(l, r)                                                 \
+       ({                                                              \
+               BAT *_l = (l), *_r = (r);                               \
+               HEADLESSDEBUG fprintf(stderr,                           \
+                       "#BATkdiff([%s,%s]#"BUNFMT",[%s,%s]#"BUNFMT") 
%s[%s:%d]\n", \
+                       _COL_TYPE(_l->H), _COL_TYPE(_l->T), BATcount(_l), \
+                       _COL_TYPE(_r->H), _COL_TYPE(_r->T), BATcount(_r), \
+                       __func__, __FILE__, __LINE__);                  \
+               BATkdiff(_l, _r);                                       \
+       })
+
 #define BATmaterializeh(b)                                             \
        ({                                                              \
                BAT *_b = (b);                                          \
diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog
--- a/monetdb5/ChangeLog
+++ b/monetdb5/ChangeLog
@@ -1,6 +1,9 @@
 # ChangeLog file for MonetDB5
 # This file is updated with Maddlog
 
+* Wed Sep 16 2015 Sjoerd Mullender <sjo...@acm.org>
+- Removed algebra.tdiff and algebra.tinter.
+
 * Mon Sep 14 2015 Sjoerd Mullender <sjo...@acm.org>
 - Removed algebra.sample.  Use sampe.subuniform instead.
 
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
@@ -894,63 +894,6 @@ ALGsemijoin(bat *result, const bat *lid,
        return ALGbinary(result, lid, rid, BATsemijoin, "algebra.semijoin");
 }
 
-/* add items missing in the kernel */
-str
-ALGtdiff(bat *result, const bat *bid, const bat *bid2)
-{
-       BAT *b, *b2, *bn;
-
-       if ((b = BATdescriptor(*bid)) == NULL)
-               throw(MAL, "algebra.tdiff", RUNTIME_OBJECT_MISSING);
-       if ((b2 = BATdescriptor(*bid2)) == NULL){
-               BBPunfix(*bid2);
-               throw(MAL, "algebra.tdiff", RUNTIME_OBJECT_MISSING);
-       }
-
-       bn = BATkdiff(BATmirror(b),BATmirror(b2));
-       BBPunfix(b->batCacheid);
-       BBPunfix(b2->batCacheid);
-       if (bn) {
-               BAT *r = BATmirror(BATmark(bn,0));
-
-               BBPunfix(bn->batCacheid);
-               bn = r;
-               if (!(bn->batDirty&2)) BATsetaccess(bn, BAT_READ);
-               *result = bn->batCacheid;
-               BBPkeepref(*result);
-               return MAL_SUCCEED;
-       }
-       throw(MAL, "algebra.tdiff", GDK_EXCEPTION);
-}
-
-str
-ALGtinter(bat *result, const bat *bid, const bat *bid2)
-{
-       BAT *b, *b2, *bn;
-
-       if ((b = BATdescriptor(*bid)) == NULL)
-               throw(MAL, "algebra.tinter", RUNTIME_OBJECT_MISSING);
-       if ((b2 = BATdescriptor(*bid2)) == NULL){
-               BBPunfix(*bid2);
-               throw(MAL, "algebra.tinter", RUNTIME_OBJECT_MISSING);
-       }
-
-       bn = BATsemijoin(BATmirror(b),BATmirror(b2));
-       BBPunfix(b->batCacheid);
-       BBPunfix(b2->batCacheid);
-       if (bn) {
-               BAT *r = BATmirror(BATmark(bn,0));
-
-               BBPunfix(bn->batCacheid);
-               bn = r;
-               if (!(bn->batDirty&2)) BATsetaccess(bn, BAT_READ);
-               *result = bn->batCacheid;
-               BBPkeepref(*result);
-               return MAL_SUCCEED;
-       }
-       throw(MAL, "algebra.tinter", GDK_EXCEPTION);
-}
-
 str
 ALGsubsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat 
*order, const bat *group, const bit *reverse, const bit *stable)
 {
diff --git a/monetdb5/modules/kernel/algebra.mal 
b/monetdb5/modules/kernel/algebra.mal
--- a/monetdb5/modules/kernel/algebra.mal
+++ b/monetdb5/modules/kernel/algebra.mal
@@ -179,14 +179,6 @@ comment "Select all unique values from t
        The output BAT is sorted on the tail value.";
 
 
-command tinter( left:bat[:oid,:oid], right:bat[:oid,:oid] ) :bat[:oid,:oid]
-address ALGtinter
-comment "Deprecated, see algebra.semijoin";
-
-command tdiff( left:bat[:oid,:oid], right:bat[:oid,:oid] ) :bat[:oid,:oid]
-address ALGtdiff
-comment "Deprecated, see algebra.subdiff";
-
 # @+ Join operations
 # The core of every relational engine.
 # The join collection provided by the GDK kernel.
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -1626,9 +1626,7 @@ OPTmergetableImplementation(Client cntxt
                /* Handle setops */
                if (match > 0 && getModuleId(p) == algebraRef &&
                    (getFunctionId(p) == subdiffRef || 
-                    getFunctionId(p) == subinterRef || 
-                    getFunctionId(p) == tdiffRef || 
-                    getFunctionId(p) == tinterRef) && 
+                    getFunctionId(p) == subinterRef) && 
                   (m=is_a_mat(getArg(p,1), &ml)) >= 0) { 
                        n=is_a_mat(getArg(p,2), &ml);
                        mat_setop(mb, p, &ml, m, n);
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
@@ -69,8 +69,6 @@ str dblRef;
 str defineRef;
 str deleteRef;
 str depositRef;
-str tdiffRef;
-str tinterRef;
 str subdiffRef;
 str subinterRef;
 str mergecandRef;
@@ -316,8 +314,6 @@ void optimizerInit(void)
        defineRef = putName("define",6);
        deleteRef = putName("delete",6);
        depositRef = putName("deposit",7);
-       tdiffRef= putName("tdiff",5);
-       tinterRef= putName("tinter",6);
        subdiffRef = putName("subdiff",7);
        subinterRef = putName("subinter",8);
        mergecandRef= putName("mergecand",9);
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
@@ -67,8 +67,6 @@ opt_export  str dblRef;
 opt_export  str defineRef;
 opt_export  str deleteRef;
 opt_export  str depositRef;
-opt_export  str tdiffRef;
-opt_export  str tinterRef;
 opt_export  str subdiffRef;
 opt_export  str subinterRef;
 opt_export  str mergecandRef;
diff --git a/monetdb5/optimizer/opt_pushselect.c 
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -163,9 +163,7 @@ OPTpushselectImplementation(Client cntxt
 
                if (getModuleId(p) == algebraRef && 
                        (getFunctionId(p) == subinterRef || 
-                        getFunctionId(p) == subdiffRef || 
-                        getFunctionId(p) == tinterRef || 
-                        getFunctionId(p) == tdiffRef)) {
+                        getFunctionId(p) == subdiffRef)) {
                        GDKfree(vars);
                        return 0;
                }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to