Changeset: c847774e2fe3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c847774e2fe3 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out gdk/ChangeLog gdk/gdk.h gdk/gdk_setop.c monetdb5/ChangeLog monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/algebra.mal monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h Branch: default Log Message:
Removed BATkunion and algebra.tunion. diffs (truncated from 332 to 300 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 @@ -2517,8 +2517,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.tunion(left:bat[:any_1,:any_2],right:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGtunion; command algebra.tdiff(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] address ALGtdiff; command algebra.tinter(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 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 @@ -3028,8 +3028,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.tunion(left:bat[:any_1,:any_2],right:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGtunion; command algebra.tdiff(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] address ALGtdiff; command algebra.tinter(left:bat[:oid,:oid],right:bat[:oid,:oid]):bat[:oid,:oid] 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 @@ -143,7 +143,6 @@ BAT *BATjoin(BAT *l, BAT *r, BUN estimat BAT *BATkdiff(BAT *b, BAT *c); gdk_return BATkey(BAT *b, int onoff); BAT *BATkintersect(BAT *b, BAT *c); -BAT *BATkunion(BAT *b, BAT *c); BAT *BATleftfetchjoin(BAT *b, BAT *s, BUN estimate); BAT *BATleftjoin(BAT *l, BAT *r, BUN estimate); BAT *BATmark(BAT *b, oid base); @@ -744,7 +743,6 @@ str ALGjoin2(bat *l, bat *r, const bat * str ALGjoinPath(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str ALGjoinestimate(bat *result, const bat *lid, const bat *rid, const lng *estimate); str ALGkdiff(bat *result, const bat *lid, const bat *rid); -str ALGkunion(bat *result, const bat *lid, const bat *rid); str ALGleftfetchjoin(bat *result, const bat *lid, const bat *rid); str ALGleftjoin(bat *result, const bat *lid, const bat *rid); str ALGleftjoinestimate(bat *result, const bat *lid, const bat *rid, const lng *estimate); @@ -806,7 +804,6 @@ str ALGtmark_default(bat *result, const str ALGtmarkp(bat *result, const bat *bid, const int *nr_parts, const int *part_nr); str ALGtsort(bat *result, const bat *bid); str ALGtsort_rev(bat *result, const bat *bid); -str ALGtunion(bat *result, const bat *lid, const bat *rid); str ALGvariance(dbl *res, const bat *bid); str ALGvariancep(dbl *res, const bat *bid); str AUTHaddUser(oid *ret, Client *c, str *user, str *pass); @@ -2354,7 +2351,6 @@ str joinRef; str jsonRef; str kdifferenceRef; int keepProp; -str kunionRef; str languageRef; str leftfetchjoinPathRef; str leftfetchjoinRef; diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -1,3 +1,6 @@ # ChangeLog file for MonetDB # This file is updated with Maddlog +* Fri Aug 14 2015 Sjoerd Mullender <sjo...@acm.org> +- Removed the function BATkunion. + diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -3112,8 +3112,6 @@ gdk_export void BATsetprop(BAT *b, int i * @tab BATfragment (BAT *b, ptr l, ptr h, ptr L, ptr H) * @item * @item BAT * - * @tab BATkunion (BAT *b, BAT *c) - * @item BAT * * @tab BATkintersect (BAT *b, BAT *c) * @item BAT * * @tab BATkdiff (BAT *b, BAT *c) @@ -3192,7 +3190,6 @@ gdk_export BAT *BATleftfetchjoin(BAT *b, gdk_export BAT *BATsubunique(BAT *b, BAT *s); gdk_export BAT *BATkintersect(BAT *b, BAT *c); -gdk_export BAT *BATkunion(BAT *b, BAT *c); gdk_export BAT *BATkdiff(BAT *b, BAT *c); gdk_export BAT *BATmergecand(BAT *a, BAT *b); diff --git a/gdk/gdk_setop.c b/gdk/gdk_setop.c --- a/gdk/gdk_setop.c +++ b/gdk/gdk_setop.c @@ -24,8 +24,6 @@ * * Operands provided are: * @itemize - * @item kunion - * produces a bat union. * @item kdiff * produces bat difference. * @item kintersection @@ -44,10 +42,6 @@ * that are not in @emph{r}. They do not do double-elimination over * the @emph{l} BUNs. * - * The @emph{kunion(l,r)} operations result in all BUNs of - * @emph{l}, plus all BUNs of @emph{r} that are not in @emph{l}. They - * do not do double-elimination over the @emph{l} nor @emph{r} BUNs. - * * The @emph{kintersect(l,r)} is used also as implementation for the * @emph{semijoin()}. */ @@ -519,103 +513,3 @@ BATkintersect(BAT *l, BAT *r) { return diff_intersect(l, r, 0); } - -/* - * @+ Union - * Union consists of one version: BATkunion(l,r), which unites - * with double elimination over the head column only. The - * implementation uses the kdiff() code for - * efficient double elimination. - */ -BAT * -BATkunion(BAT *l, BAT *r) -{ - int hdisjunct, tdisjunct; - BAT *bn, *b; - BUN p,q; - BATiter li, ri; - int ht, tt; - - BATcompatible(l, r, NULL, "BATkunion"); - if (BATcount(l) == 0) { - b = l; - l = r; - r = b; - } - if (BATcount(r) == 0) { - return BATcopy(l, l->htype, l->ttype, FALSE, TRANSIENT); - } - - b = NULL; - li = bat_iterator(l); - ri = bat_iterator(r); - hdisjunct = BAThordered(r) & BAThordered(l) && - ATOMcmp(l->htype, BUNhead(li, BUNlast(l) - 1), BUNhead(ri, BUNfirst(r))) < 0; - tdisjunct = BATtordered(r) & BATtordered(l) && - ATOMcmp(l->ttype, BUNtail(li, BUNlast(l) - 1), BUNtail(ri, BUNfirst(r))) < 0; - - if (!hdisjunct) { - b = r; - ri.b = r = BATkdiff(r, l); - if (r == NULL) { - return NULL; - } - } - - if (BATcount(r) == 0) { - if (b) - BBPreclaim(r); - return BATcopy(l, l->htype, l->ttype, FALSE, TRANSIENT); - } - - ht = l->htype; - tt = l->ttype; - if (ht == TYPE_void && l->hseqbase != oid_nil) - ht = TYPE_oid; - if (tt == TYPE_void && l->tseqbase != oid_nil) - tt = TYPE_oid; - bn = BATcopy(l, ht, tt, TRUE, TRANSIENT); - if (bn == NULL) { - if (b) - BBPreclaim(r); - return NULL; - } - BATloop(r, p, q) { - bunfastins(bn, BUNhead(ri, p), BUNtail(ri, p)); - } - if (!BAThdense(l) || !BAThdense(r) || - * (oid *) BUNhead(li, BUNlast(l) - 1) + 1 != * (oid *) BUNhead(ri, BUNfirst(r))) { - bn->hseqbase = oid_nil; - bn->hdense = 0; - } - if (!BATtdense(l) || !BATtdense(r) || - * (oid *) BUNtail(li, BUNlast(l) - 1) + 1 != * (oid *) BUNtail(ri, BUNfirst(r))) { - bn->tseqbase = oid_nil; - bn->tdense = 0; - } - bn->H->nonil = l->H->nonil & r->H->nonil; - bn->T->nonil = l->T->nonil & r->T->nonil; - bn->H->nil = l->H->nil | r->H->nil; - bn->T->nil = l->T->nil | r->T->nil; - if (b) { - BBPreclaim(r); - r = b; - } - HASHdestroy(bn); - - bn->hsorted = hdisjunct; - bn->hrevsorted = 0; - bn->tsorted = tdisjunct; - bn->trevsorted = 0; - bn->talign = bn->halign = 0; - if (!r->hkey) - BATkey(bn, FALSE); - BATkey(BATmirror(bn), tdisjunct && BATtkey(l) && BATtkey(r)); - - return bn; - bunins_failed: - BBPreclaim(bn); - if (b) - BBPreclaim(r); - return NULL; -} diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog --- a/monetdb5/ChangeLog +++ b/monetdb5/ChangeLog @@ -1,3 +1,6 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog +* Fri Aug 14 2015 Sjoerd Mullender <sjo...@acm.org> +- Removed algebra.tunion. + 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 @@ -1177,12 +1177,6 @@ ALGsemijoin(bat *result, const bat *lid, } str -ALGkunion(bat *result, const bat *lid, const bat *rid) -{ - return ALGbinary(result, lid, rid, BATkunion, "algebra.kunion"); -} - -str ALGkdiff(bat *result, const bat *lid, const bat *rid) { return ALGbinary(result, lid, rid, BATkdiff, "algebra.kdiff"); @@ -1196,33 +1190,6 @@ ALGsample(bat *result, const bat *bid, c /* add items missing in the kernel */ str -ALGtunion(bat *result, const bat *bid, const bat *bid2) -{ - BAT *b, *b2, *bn; - - if ((b = BATdescriptor(*bid)) == NULL) - throw(MAL, "algebra.tunion", RUNTIME_OBJECT_MISSING); - if ((b2 = BATdescriptor(*bid2)) == NULL){ - BBPunfix(*bid2); - throw(MAL, "algebra.tunion", RUNTIME_OBJECT_MISSING); - } - - bn = BATkunion(BATmirror(b),BATmirror(b2)); - if (bn) { - bn = BATmirror(bn); - if (!(bn->batDirty&2)) BATsetaccess(bn, BAT_READ); - *result = bn->batCacheid; - BBPkeepref(*result); - BBPunfix(b->batCacheid); - BBPunfix(b2->batCacheid); - return MAL_SUCCEED; - } - BBPunfix(b->batCacheid); - BBPunfix(b2->batCacheid); - throw(MAL, "algebra.tunion", GDK_EXCEPTION); -} - -str ALGtdifference(bat *result, const bat *bid, const bat *bid2) { BAT *b, *b2, *bn; 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 @@ -75,8 +75,6 @@ algebra_export str ALGleftfetchjoin(bat algebra_export str ALGouterjoinestimate(bat *result, const bat *lid, const bat *rid, const lng *estimate); algebra_export str ALGouterjoin(bat *result, const bat *lid, const bat *rid); algebra_export str ALGsemijoin(bat *result, const bat *lid, const bat *rid); -algebra_export str ALGkunion(bat *result, const bat *lid, const bat *rid); -algebra_export str ALGtunion(bat *result, const bat *lid, const bat *rid); algebra_export str ALGtintersect(bat *result, const bat *lid, const bat *rid); algebra_export str ALGtinter(bat *result, const bat *lid, const bat *rid); algebra_export str ALGkdiff(bat *result, const bat *lid, const bat *rid); 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 @@ -227,10 +227,6 @@ address ALGtinter; command tdiff( left:bat[:oid,:oid], right:bat[:oid,:oid] ) :bat[:oid,:oid] address ALGtdiff; -command tunion ( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2]) - :bat[:any_1,:any_2] -address ALGtunion; - # @+ Join operations _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list