Changeset: 69a4de87b55d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69a4de87b55d
Removed Files:
        gdk/gdk_join_legacy.c
Modified Files:
        clients/Tests/exports.stable.out
        gdk/ChangeLog
        gdk/Makefile.ag
        gdk/gdk.h
        gdk/gdk_align.c
        gdk/gdk_batop.c
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/algebra.h
Branch: default
Log Message:

Removed BATsemijoin.


diffs (250 lines):

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
@@ -163,7 +163,6 @@ BAT *BATsample(BAT *b, BUN n);
 gdk_return BATsave(BAT *b);
 BAT *BATselect(BAT *b, const void *tl, const void *th);
 BAT *BATselect_(BAT *b, const void *tl, const void *th, bit li, bit hi);
-BAT *BATsemijoin(BAT *l, BAT *r);
 void BATseqbase(BAT *b, oid o);
 gdk_return BATsetaccess(BAT *b, int mode);
 void BATsetcapacity(BAT *b, BUN cnt);
@@ -724,7 +723,6 @@ str ALGrangejoin2(bat *l, bat *r, const 
 str ALGreuse(bat *ret, const bat *bid);
 str ALGsample(bat *result, const bat *bid, const int *param);
 str ALGselectNotNil(bat *result, const bat *bid);
-str ALGsemijoin(bat *result, const bat *lid, const bat *rid);
 str ALGslice(bat *ret, const bat *bid, const lng *start, const lng *end);
 str ALGslice_int(bat *ret, const bat *bid, const int *start, const int *end);
 str ALGslice_oid(bat *ret, const bat *bid, const oid *start, const oid *end);
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -2,6 +2,7 @@
 # This file is updated with Maddlog
 
 * Wed Sep 16 2015 Sjoerd Mullender <sjo...@acm.org>
+- Removed BATsemijoin.  Use BATsubsemijoin instead.
 - Removed BATjoin.  Use BATsubjoin instead.
 - Removed BATleftjoin.  Use BATsubleftjoin or BATproject instead.
 - Removed BATleftfetchjoin.  Use BATproject instead.
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -27,7 +27,7 @@ lib_gdk = {
                gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
                gdk_aggr.c gdk_group.c gdk_mapreduce.c gdk_mapreduce.h \
                gdk_imprints.c gdk_imprints.h \
-               gdk_join.c gdk_join_legacy.c \
+               gdk_join.c \
                gdk_unique.c \
                gdk_firstn.c \
                bat.feps bat1.feps bat2.feps \
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3065,8 +3065,6 @@ gdk_export void BATsetprop(BAT *b, int i
  * @- BAT relational operators
  *  @multitable @columnfractions 0.08 0.7
  * @item BAT *
-  * @tab BATsemijoin (BAT *l, BAT *r)
- * @item BAT *
  * @tab BATselect (BAT *b, ptr tl, ptr th)
  * @item BAT *
  * @tab BATfragment (BAT *b, ptr l, ptr h, ptr L, ptr H)
@@ -3083,9 +3081,6 @@ gdk_export void BATsetprop(BAT *b, int i
  * Interpretation of a NULL argument depends on the position, i.e. a
  * domain lower or upper bound.
  *
- * The BATsemijoin over R[A, B] and S[C, D] produces the subset of
- * R[A, B] that satisfies the semijoin over A and C.
- *
  * The full-materialization policy intermediate results in MonetDB
  * means that a join can produce an arbitrarily large result and choke
  * the system. The Data Distilleries tool therefore first computes the
@@ -3112,7 +3107,6 @@ gdk_export BAT *BATselect(BAT *b, const 
 
 gdk_export BAT *BATconstant(int tt, const void *val, BUN cnt, int role);
 gdk_export BAT *BATconst(BAT *l, int tt, const void *val, int role);
-gdk_export BAT *BATsemijoin(BAT *l, BAT *r);
 gdk_export gdk_return BATcross1(BAT **r1p, BAT **r2p, BAT *l, BAT *r);
 gdk_export gdk_return BATsubcross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT 
*sl, BAT *sr);
 
@@ -3186,17 +3180,6 @@ gdk_export BAT *BATsample(BAT *b, BUN n)
                BATselect(_b, (h), (t));                                \
        })
 
-#define BATsemijoin(l, r)                                              \
-       ({                                                              \
-               BAT *_l = (l), *_r = (r);                               \
-               HEADLESSDEBUG fprintf(stderr,                           \
-                       "#BATsemijoin([%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__);                  \
-               BATsemijoin(_l, _r);                                    \
-       })
-
 #endif
 #endif
 
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -27,8 +27,7 @@
  * (likewise, @emph{BATcopy()}, which makes a copy, instead of
  * in-place shuffling, has the same alignment effect, @emph{BATmark()}
  * marks the tail column as synced with the head of the original
- * @emph{BAT}, and for instance @emph{BATsemijoin()} marks both return
- * columns as aligned with its left parameter).
+ * @emph{BAT}).
  *
  * Each alignment sequence is given a unique identifier, so as to
  * easily detect this situation. It is retained in the @emph{BAT
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -939,8 +939,7 @@ BATreplace(BAT *b, BAT *p, BAT *n, bit f
  * recomputed in the result).
  *
  * Note that the BATslice() is used indirectly as well as a special
- * case for BATselect (range selection on sorted column) and
- * BATsemijoin (when two dense columns are semijoined).
+ * case for BATselect (range selection on sorted column).
  *
  * NOTE new semantics, the selected range is excluding the high value.
  */
diff --git a/gdk/gdk_join_legacy.c b/gdk/gdk_join_legacy.c
deleted file mode 100644
--- a/gdk/gdk_join_legacy.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 2008-2015 MonetDB B.V.
- */
-
-#include "monetdb_config.h"
-#include "gdk.h"
-#include "gdk_private.h"
-
-/* This file contains the legacy interface to the join functions */
-
-#undef BATsemijoin
-
-/* Return a subset of l where head elements occur as head element in r. */
-BAT *
-BATsemijoin(BAT *l, BAT *r)
-{
-       BAT *lmap;
-       BAT *res1, *res2;
-       BAT *bn;
-
-       if (BATcount(l) == 0)
-               return BATcopy(l, l->htype, l->ttype, 0, TRANSIENT);
-       if (BATcount(r) == 0) {
-               bn = BATnew(l->htype, l->ttype, 0, TRANSIENT);
-               if (bn) {
-                       if (BAThdense(l))
-                               BATseqbase(bn, l->hseqbase);
-                       if (BATtdense(l))
-                               BATseqbase(BATmirror(bn), l->tseqbase);
-               }
-               return bn;
-       }
-
-       if (BAThdense(l) && BAThdense(r)) {
-               oid lo = l->hseqbase, hi = lo + BATcount(l);
-
-               if (lo < r->hseqbase)
-                       lo = r->hseqbase;
-               if (hi > r->hseqbase + BATcount(r))
-                       hi = r->hseqbase + BATcount(r);
-               if (hi < lo)
-                       hi = lo;
-               return BATslice(l, lo - l->hseqbase, hi - l->hseqbase);
-       }
-
-       /* l is [any_1,any_2]; r is [any_1,any_3] */
-       l = BATmirror(l);
-       r = BATmirror(r);
-       /* now: l is [any_2,any_1], r is [any_3,any_1] */
-       if (!BAThdense(l) || !BAThdense(r)) {
-               /* l is [any_2,any_1] */
-               lmap = BATmirror(BATmark(l, 0));
-               /* lmap is [dense1,any_2] */
-               l = BATmirror(BATmark(BATmirror(l), 0));
-               /* l is [dense1,any_1] */
-               /* r is [any_3,any_1] */
-               r = BATmirror(BATmark(BATmirror(r), 0));
-               /* r is [dense2,any_1] */
-       } else {
-               /* l is [dense1,any_1] (i.e. any_2==dense1) */
-               lmap = NULL;
-               BBPfix(l->batCacheid);
-               /* r is [dense2,any_1] */
-               BBPfix(r->batCacheid);
-       }
-       if (BATsubsemijoin(&res1, NULL, l, r, NULL, NULL, 0, BATcount(l)) != 
GDK_SUCCEED) {
-               if (lmap)
-                       BBPunfix(lmap->batCacheid);
-               BBPunfix(l->batCacheid);
-               BBPunfix(r->batCacheid);
-               return NULL;
-       }
-       BBPunfix(r->batCacheid);
-       if (lmap) {
-               /* res1 is [dense,sub(dense1)] */
-               bn = BATproject(res1, lmap);
-               BBPunfix(lmap->batCacheid);
-               lmap = NULL;
-               /* bn is [dense,any_2] */
-               res2 = BATproject(res1, l);
-               /* res2 is [dense,any_1] */
-               BBPunfix(res1->batCacheid);
-               res1 = bn;
-               /* res1 is [dense,any_2] */
-       } else {
-               /* res1 is [dense,sub(dense1)] */
-               res2 = BATproject(res1, l);
-               /* res2 is [dense,any_1] */
-       }
-       BBPunfix(l->batCacheid);
-       res2 = BATmirror(res2);
-       /* res2 is [any_1,dense] */
-       bn = VIEWcreate(res2, res1);
-       /* bn is [any_1,any_2] */
-       BBPunfix(res1->batCacheid);
-       BBPunfix(res2->batCacheid);
-       return bn;
-}
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
@@ -852,12 +852,6 @@ ALGleftfetchjoin(bat *result, const bat 
 }
 
 str
-ALGsemijoin(bat *result, const bat *lid, const bat *rid)
-{
-       return ALGbinary(result, lid, rid, BATsemijoin, "algebra.semijoin");
-}
-
-str
 ALGsubsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat 
*order, const bat *group, const bit *reverse, const bit *stable)
 {
        BAT *bn = NULL, *on = NULL, *gn = NULL;
diff --git a/monetdb5/modules/kernel/algebra.h 
b/monetdb5/modules/kernel/algebra.h
--- a/monetdb5/modules/kernel/algebra.h
+++ b/monetdb5/modules/kernel/algebra.h
@@ -60,7 +60,6 @@ algebra_export str ALGcopy(bat *result, 
 algebra_export str ALGsubunique2(bat *result, const bat *bid, const bat *sid);
 algebra_export str ALGsubunique1(bat *result, const bat *bid);
 algebra_export str ALGleftfetchjoin(bat *result, const bat *lid, const bat 
*rid);
-algebra_export str ALGsemijoin(bat *result, const bat *lid, const bat *rid);
 algebra_export str ALGtinter(bat *result, const bat *lid, const bat *rid);
 algebra_export str ALGtdiff(bat *result, const bat *lid, const bat *rid);
 algebra_export str ALGsample(bat *result, const bat *bid, const int *param);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to