Changeset: ef4f0de2c3db for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ef4f0de2c3db 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_setop.c monetdb5/ChangeLog.Oct2014 monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/algebra.mal monetdb5/optimizer/opt_costModel.c monetdb5/optimizer/opt_emptySet.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h monetdb5/tests/BugTracker/Tests/kunion-and-nil.Bug-1667.mal monetdb5/tests/BugTracker/Tests/kunion-and-nil.Bug-1667.stable.out monetdb5/tests/gdkTests/Tests/subgroup.mal monetdb5/tests/gdkTests/Tests/subgroup.stable.out testing/Mtest.py.in Branch: Oct2014 Log Message:
Removed algebra.kunique and algebra.tunique. Removed BATkunique. diffs (truncated from 586 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 @@ -2494,10 +2494,6 @@ command algebra.kintersect(left:bat[:any address ALGsemijoin; comment Returns the intersection taken over only the *head* columns of two BATs. Results in all BUNs of 'left' that are also in 'right'. Does *not* do double- elimination over the 'left' BUNs. If you want this, use: 'kintersect(kunique(left),kunique(right))' or: 'kunique(kintersect(left,right))'. -command algebra.kunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGkunique; -comment Select unique tuples from the input BAT. Double elimination is done only looking at the head column. The result is a BAT with property hkeyed() == true. - pattern algebra.leftfetchjoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath; comment Routine to handle join paths. The type analysis is rather tricky. @@ -2779,10 +2775,6 @@ command algebra.tinter(left:bat[:oid,:oi address ALGtinter; command algebra.tintersect(left:bat[:any_1,:any_2],right:bat[:any_1,:any]):bat[:any_1,:any_2] address ALGtintersect; -command algebra.tunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -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.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 @@ -2495,10 +2495,6 @@ command algebra.kintersect(left:bat[:any address ALGsemijoin; comment Returns the intersection taken over only the *head* columns of two BATs. Results in all BUNs of 'left' that are also in 'right'. Does *not* do double- elimination over the 'left' BUNs. If you want this, use: 'kintersect(kunique(left),kunique(right))' or: 'kunique(kintersect(left,right))'. -command algebra.kunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGkunique; -comment Select unique tuples from the input BAT. Double elimination is done only looking at the head column. The result is a BAT with property hkeyed() == true. - pattern algebra.leftfetchjoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath; comment Routine to handle join paths. The type analysis is rather tricky. @@ -2780,10 +2776,6 @@ command algebra.tinter(left:bat[:oid,:oi address ALGtinter; command algebra.tintersect(left:bat[:any_1,:any_2],right:bat[:any_1,:any]):bat[:any_1,:any_2] address ALGtintersect; -command algebra.tunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -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.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 @@ -2495,10 +2495,6 @@ command algebra.kintersect(left:bat[:any address ALGsemijoin; comment Returns the intersection taken over only the *head* columns of two BATs. Results in all BUNs of 'left' that are also in 'right'. Does *not* do double- elimination over the 'left' BUNs. If you want this, use: 'kintersect(kunique(left),kunique(right))' or: 'kunique(kintersect(left,right))'. -command algebra.kunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGkunique; -comment Select unique tuples from the input BAT. Double elimination is done only looking at the head column. The result is a BAT with property hkeyed() == true. - pattern algebra.leftfetchjoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath; comment Routine to handle join paths. The type analysis is rather tricky. @@ -2780,10 +2776,6 @@ command algebra.tinter(left:bat[:oid,:oi address ALGtinter; command algebra.tintersect(left:bat[:any_1,:any_2],right:bat[:any_1,:any]):bat[:any_1,:any_2] address ALGtintersect; -command algebra.tunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -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.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 @@ -2494,10 +2494,6 @@ command algebra.kintersect(left:bat[:any address ALGsemijoin; comment Returns the intersection taken over only the *head* columns of two BATs. Results in all BUNs of 'left' that are also in 'right'. Does *not* do double- elimination over the 'left' BUNs. If you want this, use: 'kintersect(kunique(left),kunique(right))' or: 'kunique(kintersect(left,right))'. -command algebra.kunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -address ALGkunique; -comment Select unique tuples from the input BAT. Double elimination is done only looking at the head column. The result is a BAT with property hkeyed() == true. - pattern algebra.leftfetchjoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath; comment Routine to handle join paths. The type analysis is rather tricky. @@ -2779,10 +2775,6 @@ command algebra.tinter(left:bat[:oid,:oi address ALGtinter; command algebra.tintersect(left:bat[:any_1,:any_2],right:bat[:any_1,:any]):bat[:any_1,:any_2] address ALGtintersect; -command algebra.tunique(b:bat[:any_1,:any_2]):bat[:any_1,:any_2] -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.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 @@ -143,7 +143,6 @@ BAT *BATkdiff(BAT *b, BAT *c); BAT *BATkey(BAT *b, int onoff); BAT *BATkintersect(BAT *b, BAT *c); BAT *BATkunion(BAT *b, BAT *c); -BAT *BATkunique(BAT *b); BAT *BATleftfetchjoin(BAT *b, BAT *s, BUN estimate); BAT *BATleftjoin(BAT *l, BAT *r, BUN estimate); BAT *BATmark(BAT *b, oid base); @@ -753,7 +752,6 @@ BAT *ALGjoinPathBody(Client cntxt, int t str ALGjoinestimate(int *result, int *lid, int *rid, lng *estimate); str ALGkdiff(int *result, int *lid, int *rid); str ALGkunion(int *result, int *lid, int *rid); -str ALGkunique(int *result, int *bid); str ALGleftfetchjoin(int *result, int *lid, int *rid); str ALGleftjoin(int *result, int *lid, int *rid); str ALGleftjoinestimate(int *result, int *lid, int *rid, lng *estimate); @@ -822,7 +820,6 @@ str ALGtmarkp(int *result, int *bid, int str ALGtsort(int *result, int *bid); str ALGtsort_rev(int *result, int *bid); str ALGtunion(int *result, int *lid, int *rid); -str ALGtunique(int *result, int *bid); str ALGuselect(int *result, int *bid, ptr low, ptr high); str ALGuselect1(int *result, int *bid, ptr value); str ALGuselectInclusive(int *result, int *bid, ptr low, ptr high, bit *lin, bit *rin); @@ -2391,7 +2388,6 @@ str jsonRef; str kdifferenceRef; int keepProp; str kunionRef; -str kuniqueRef; str languageRef; str lastline(Client cntxt); str leftfetchjoinPathRef; @@ -2771,7 +2767,6 @@ void trimMalBlk(MalBlkPtr mb); void trimMalVariables(MalBlkPtr mb, MalStkPtr stk); void trimMalVariables_(MalBlkPtr mb, bit *used, MalStkPtr glb); int tubProp; -str tuniqueRef; void typeChecker(stream *out, Module scope, MalBlkPtr mb, InstrPtr p, int silent); int tzone_fromstr(const char *buf, int *len, tzone **d); tzone tzone_local; diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -3219,8 +3219,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 BATkunique (BAT *b) - * @item BAT * * @tab BATkunion (BAT *b, BAT *c) * @item BAT * * @tab BATkintersect (BAT *b, BAT *c) @@ -3255,9 +3253,6 @@ gdk_export void BATsetprop(BAT *b, int i * implementations. TODO: add this for * semijoin/select/unique/diff/intersect * - * The routine BATtunique considers only the head column, and produces - * a unique head column. - * * @- modes for thethajoin */ #define JOIN_EQ 0 @@ -3304,7 +3299,6 @@ gdk_export BAT *BATleftfetchjoin(BAT *b, gdk_export BAT *BATsubunique(BAT *b, BAT *s); -gdk_export BAT *BATkunique(BAT *b); gdk_export BAT *BATkintersect(BAT *b, BAT *c); gdk_export BAT *BATkunion(BAT *b, BAT *c); gdk_export BAT *BATkdiff(BAT *b, BAT *c); diff --git a/gdk/gdk_setop.c b/gdk/gdk_setop.c --- a/gdk/gdk_setop.c +++ b/gdk/gdk_setop.c @@ -35,8 +35,6 @@ * * Operands provided are: * @itemize - * @item kunique - * produces a copy of the bat, with double elimination * @item kunion * produces a bat union. * @item kdiff @@ -61,9 +59,6 @@ * @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. * - * Operations with double-elimination can be formed by performing - * @emph{kunique(l)} on their operands. - * * The @emph{kintersect(l,r)} is used also as implementation for the * @emph{semijoin()}. */ @@ -98,93 +93,6 @@ */ /* - * @- Unique - * The routine BATkunique removes duplicate head entries. - */ -BAT * -BATkunique(BAT *b) -{ - BAT *bn; - BAT *bn1 = NULL; - BAT *map; - BAT *b1; - - BATcheck(b, "BATkunique"); - - if (b->hkey) { - bn = BATcopy(b, b->htype, b->ttype, FALSE, TRANSIENT); - } else { - b = BATmirror(b); /* work on tail instead of head */ - /* b is a [any_1,any_2] BAT */ - if (!BAThdense(b)) { - map = BATmirror(BATmark(b, 0)); /* [dense1,any_1] */ - b1 = BATmirror(BATmark(BATmirror(b), 0)); /* [dense1,any_2] */ - } else { - map = NULL; - b1 = b; /* [dense1,any_2] (any_1==dense1) */ - } - bn = BATsubunique(b1, NULL); - if (bn == NULL) - goto error; - /* bn is a [dense2,oid1] BAT with oid1 a subset of dense1 */ - /* we want to return a [any_1,any_2] subset of b */ - if (map) { - bn1 = BATproject(bn, map); - if (bn1 == NULL) - goto error; - /* bn1 is [dense2,any_1] */ - BBPunfix(map->batCacheid); - map = BATmirror(bn1); - /* map is [any_1,dense2] */ - bn1 = BATproject(bn, b1); - if (bn1 == NULL) - goto error; - /* bn1 is [dense2,any_2] */ - BBPunfix(b1->batCacheid); - b1 = NULL; - BBPunfix(bn->batCacheid); - bn = VIEWcreate(map, bn1); - if (bn == NULL) - goto error; - /* bn is [any_1,any_2] */ - BBPunfix(bn1->batCacheid); - BBPunfix(map->batCacheid); - bn1 = map = NULL; - } else { - bn1 = BATproject(bn, b); - if (bn1 == NULL) - goto error; - /* bn1 is [dense2,any_2] */ - /* bn was [dense2,any_1] since b was hdense */ - b1 = VIEWcreate(BATmirror(bn), bn1); - if (b1 == NULL) - goto error; - /* b1 is [any_1,any_2] */ - BBPunfix(bn->batCacheid); - bn = b1; - b1 = NULL; - BBPunfix(bn1->batCacheid); - bn1 = NULL; - } - bn = BATmirror(bn); - } - BATkey(bn, TRUE); - - return bn; - - error: - if (map) - BBPunfix(map->batCacheid); - if (b1 && b1 != b) - BBPunfix(b1->batCacheid); - if (bn1) - BBPunfix(bn1->batCacheid); - if (bn) - BBPunfix(bn->batCacheid); - return NULL; -} - -/* * @+ Difference and Intersect * Difference and Intersection are handled together. BATkdiff(l,r) * and BATkintersect(l,r) @@ -597,7 +505,7 @@ BATkintersect(BAT *l, BAT *r) * @+ Union * Union consists of one version: BATkunion(l,r), which unites * with double elimination over the head column only. The - * implementation uses the kdiff() and kunique() code for + * implementation uses the kdiff() code for * efficient double elimination. */ BAT * diff --git a/monetdb5/ChangeLog.Oct2014 b/monetdb5/ChangeLog.Oct2014 --- a/monetdb5/ChangeLog.Oct2014 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list