Changeset: 8fb10c95b301 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8fb10c95b301 Modified Files: gdk/ChangeLog gdk/gdk.h gdk/gdk_align.c gdk/gdk_bat.c gdk/gdk_batop.c gdk/gdk_join.c monetdb5/mal/Tests/tst275.stable.out monetdb5/modules/kernel/bat5.c monetdb5/modules/mal/tablet.c sql/backends/monet5/UDF/capi/capi.c Branch: default Log Message:
Removed tnodense property. diffs (truncated from 392 to 300 lines): diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog file for MonetDB # This file is updated with Maddlog +* Thu Jan 18 2018 Sjoerd Mullender <[email protected]> +- Removed the tnodense property: it was maintained but never actually + used, not even stored. + * Tue Nov 7 2017 Sjoerd Mullender <[email protected]> - The NIL representation of the internal flt and dbl types was changed from the smallest representable finite value to NaN (not-a-number). diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -786,7 +786,6 @@ typedef struct { BUN nokey[2]; /* positions that prove key==FALSE */ BUN nosorted; /* position that proves sorted==FALSE */ BUN norevsorted; /* position that proves revsorted==FALSE */ - BUN nodense; /* position that proves dense==FALSE */ oid seq; /* start of dense head sequence */ Heap heap; /* space for the column. */ @@ -860,7 +859,6 @@ typedef struct BATiter { #define tnokey T.nokey #define tnosorted T.nosorted #define tnorevsorted T.norevsorted -#define tnodense T.nodense #define theap T.heap #define tvheap T.vheap #define thash T.hash @@ -1027,7 +1025,7 @@ gdk_export bte ATOMelmshift(int sz); * pointer and BUN identifier. * @itemize * @item - * BAThtype(b) and BATttype(b) find out the head and tail type of a BAT. + * BATttype(b) finds out the type of a BAT. * @item * BUNlast(b) returns the BUN pointer directly after the last BUN * in the BAT. diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -92,7 +92,6 @@ ALIGNsetT(BAT *b1, BAT *b2) b1->tnokey[0] = b1->tnokey[1]; } b1->tnosorted = b2->tnosorted; - b1->tnodense = b2->tnodense; } /* @@ -454,10 +453,6 @@ VIEWbounds(BAT *b, BAT *view, BUN l, BUN view->tnorevsorted -= l; else view->tnorevsorted = 0; - if (view->tnodense > l && view->tnodense < l + cnt) - view->tnodense -= l; - else - view->tnodense = 0; if (view->tnokey[0] >= l && view->tnokey[0] < l + cnt && view->tnokey[1] >= l && view->tnokey[1] < l + cnt && view->tnokey[0] != view->tnokey[1]) { diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -543,7 +543,7 @@ BATclear(BAT *b, int force) BATtseqbase(b, 0); b->batDirty = TRUE; BATsettrivprop(b); - b->tnosorted = b->tnorevsorted = b->tnodense = 0; + b->tnosorted = b->tnorevsorted = 0; b->tnokey[0] = b->tnokey[1] = 0; return GDK_SUCCEED; } @@ -816,10 +816,6 @@ COLcopy(BAT *b, int tt, int writable, in bn->tnorevsorted = b->tnorevsorted; else bn->tnorevsorted = 0; - if (b->tnodense > 0 && b->tnodense < h) - bn->tnodense = b->tnodense; - else - bn->tnodense = 0; if (b->tnokey[0] < h && b->tnokey[1] < h && b->tnokey[0] != b->tnokey[1]) { @@ -831,7 +827,7 @@ COLcopy(BAT *b, int tt, int writable, in } else { bn->tsorted = bn->trevsorted = 0; /* set based on count later */ bn->tdense = bn->tnonil = 0; - bn->tnosorted = bn->tnorevsorted = bn->tnodense = 0; + bn->tnosorted = bn->tnorevsorted = 0; bn->tnokey[0] = bn->tnokey[1] = 0; } if (BATcount(bn) <= 1) { @@ -907,7 +903,6 @@ setcolprops(BAT *b, const void *x) b->tnosorted = b->tnorevsorted = 0; b->tkey = 1; b->tnokey[0] = b->tnokey[1] = 0; - b->tnodense = 0; if (b->ttype == TYPE_void) { if (x) { b->tseqbase = * (const oid *) x; @@ -920,8 +915,6 @@ setcolprops(BAT *b, const void *x) if (b->ttype == TYPE_oid) { b->tdense = !isnil; b->tseqbase = * (const oid *) x; - if (isnil) - b->tnodense = BUNlast(b); } } } else if (b->ttype == TYPE_void) { @@ -975,7 +968,6 @@ setcolprops(BAT *b, const void *x) } if (b->tdense && (cmp >= 0 || * (const oid *) prv + 1 != * (const oid *) x)) { b->tdense = 0; - b->tnodense = pos; } if (isnil) { b->tnonil = 0; @@ -1166,11 +1158,9 @@ BUNinplace(BAT *b, BUN p, const void *t, if (prv != BUN_NONE && 1 + * (oid *) BUNtloc(bi, prv) != * (oid *) t) { b->tdense = FALSE; - b->tnodense = p; } else if (nxt != BUN_NONE && * (oid *) BUNtloc(bi, nxt) != 1 + * (oid *) t) { b->tdense = FALSE; - b->tnodense = nxt; } else if (prv == BUN_NONE && nxt == BUN_NONE) { b->tseqbase = * (oid *) t; @@ -1380,8 +1370,6 @@ BATsetcount(BAT *b, BUN cnt) b->tnosorted = 0; if (b->tnorevsorted >= BUNlast(b)) b->tnorevsorted = 0; - if (b->tnodense >= BUNlast(b)) - b->tnodense = 0; if (b->tnokey[0] >= BUNlast(b) || b->tnokey[1] >= BUNlast(b)) { b->tnokey[0] = 0; b->tnokey[1] = 0; @@ -1476,14 +1464,14 @@ BATkey(BAT *b, int flag) void BAThseqbase(BAT *b, oid o) { - if (b == NULL) - return; - assert(o <= GDK_oid_max); /* i.e., not oid_nil */ - assert(o + BATcount(b) <= GDK_oid_max); - assert(b->batCacheid > 0); - if (b->hseqbase != o) { - b->batDirtydesc = TRUE; - b->hseqbase = o; + if (b != NULL) { + assert(o <= GDK_oid_max); /* i.e., not oid_nil */ + assert(o + BATcount(b) <= GDK_oid_max); + assert(b->batCacheid > 0); + if (b->hseqbase != o) { + b->batDirtydesc = TRUE; + b->hseqbase = o; + } } } @@ -1500,9 +1488,10 @@ BATtseqbase(BAT *b, oid o) b->batDirtydesc = TRUE; } b->tseqbase = o; - if (b->ttype == TYPE_oid && is_oid_nil(o)) { + if (is_oid_nil(o)) { b->tdense = 0; - b->tnodense = 0; + } else if (b->ttype == TYPE_void) { + b->tdense = 1; } /* adapt keyness */ @@ -2044,26 +2033,33 @@ BATassertProps(BAT *b) assert(!b->tvarsized); /* shift and width have a particular relationship */ assert(b->tshift >= 0); - if (b->tdense) - assert(b->ttype == TYPE_oid || b->ttype == TYPE_void); + /* only oid/void columns can be dense */ + assert(!b->tdense || b->ttype == TYPE_oid || b->ttype == TYPE_void); + if (b->ttype == TYPE_oid && b->tdense) { + assert(b->tsorted); + assert(!is_oid_nil(b->tseqbase)); + if (b->batCount > 0) { + assert(!is_oid_nil(b->tseqbase)); + assert(* (oid *) BUNtail(bi, 0) == b->tseqbase); + } + } /* a column cannot both have and not have NILs */ assert(!b->tnil || !b->tnonil); assert(b->tseqbase <= oid_nil); if (b->ttype == TYPE_void) { assert(b->tshift == 0); assert(b->twidth == 0); + assert(b->tsorted); if (is_oid_nil(b->tseqbase)) { assert(BATcount(b) == 0 || !b->tnonil); assert(BATcount(b) <= 1 || !b->tkey); /* assert(!b->tdense); */ - assert(b->tsorted); assert(b->trevsorted); } else { assert(BATcount(b) == 0 || !b->tnil); assert(BATcount(b) <= 1 || !b->trevsorted); /* assert(b->tdense); */ assert(b->tkey); - assert(b->tsorted); } return; } @@ -2072,14 +2068,6 @@ BATassertProps(BAT *b) else assert(b->twidth == ATOMsize(b->ttype)); assert(1 << b->tshift == b->twidth); - if (b->ttype == TYPE_oid && b->tdense) { - assert(b->tsorted); - assert(!is_oid_nil(b->tseqbase)); - if (b->batCount > 0) { - assert(!is_oid_nil(b->tseqbase)); - assert(* (oid *) BUNtail(bi, 0) == b->tseqbase); - } - } /* only linear atoms can be sorted */ assert(!b->tsorted || ATOMlinear(b->ttype)); assert(!b->trevsorted || ATOMlinear(b->ttype)); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -640,7 +640,6 @@ BATappend(BAT *b, BAT *n, BAT *s, bit fo if (cand == NULL) { b->tnosorted = start <= n->tnosorted && n->tnosorted < end ? n->tnosorted - start : 0; b->tnorevsorted = start <= n->tnorevsorted && n->tnorevsorted < end ? n->tnorevsorted - start : 0; - b->tnodense = start <= n->tnodense && n->tnodense < end ? n->tnodense - start : 0; if (n->tdense && n->ttype == TYPE_oid) b->tseqbase = *(oid *) BUNtail(ni, start); else if (n->ttype == TYPE_void && @@ -668,7 +667,6 @@ BATappend(BAT *b, BAT *n, BAT *s, bit fo b->tnosorted = 0; if (b->tdense) { b->tdense = FALSE; - b->tnodense = r; } } if (BATtrevordered(b) && @@ -687,7 +685,6 @@ BATappend(BAT *b, BAT *n, BAT *s, bit fo cand != NULL || 1 + *(oid *) BUNtloc(bi, last) != *(oid *) BUNtail(ni, start))) { b->tdense = FALSE; - b->tnodense = cand ? 0 : r; } b->tnonil &= n->tnonil; b->tnil |= n->tnil && cnt == BATcount(n); @@ -964,10 +961,6 @@ BATslice(BAT *b, BUN l, BUN h) bn->tnorevsorted = b->tnorevsorted - l; else bn->tnorevsorted = 0; - if (b->tnodense > l && b->tnodense < h) - bn->tnodense = b->tnodense - l; - else - bn->tnodense = 0; if (b->tnokey[0] >= l && b->tnokey[0] < h && b->tnokey[1] >= l && b->tnokey[1] < h && b->tnokey[0] != b->tnokey[1]) { @@ -1004,7 +997,6 @@ BATslice(BAT *b, BUN l, BUN h) bn->tnonil = b->tnonil || bn->batCount == 0; bn->tnil = 0; /* we just don't know */ bn->tnosorted = 0; - bn->tnodense = 0; bn->tnokey[0] = bn->tnokey[1] = 0; return bn; bunins_failed: @@ -1526,7 +1518,7 @@ BATsort(BAT **sorted, BAT **order, BAT * } on->tsorted = on->trevsorted = 0; /* it won't be sorted */ on->tdense = 0; /* and hence not dense */ - on->tnosorted = on->tnorevsorted = on->tnodense = 0; + on->tnosorted = on->tnorevsorted = 0; *order = on; ords = (oid *) Tloc(on, 0); } else { diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c --- a/gdk/gdk_join.c +++ b/gdk/gdk_join.c @@ -220,7 +220,6 @@ nomatch(BAT *r1, BAT *r2, BAT *l, BAT *r r1->tsorted = 1; r1->tnosorted = 0; r1->tdense = 0; - r1->tnodense = 0; r1->tnil = 0; r1->tnonil = 1; if (r2) { @@ -229,7 +228,6 @@ nomatch(BAT *r1, BAT *r2, BAT *l, BAT *r r2->tsorted = 1; r2->tnosorted = 0; _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
