Changeset: 54e47cc79298 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/54e47cc79298 Removed Files: monetdb5/mal/Tests/tst866.maltest Modified Files: clients/Tests/MAL-signatures-hge.test clients/Tests/MAL-signatures.test clients/Tests/exports.stable.out monetdb5/ChangeLog.Dec2023 monetdb5/mal/Tests/All monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/bat5.h Branch: Dec2023 Log Message:
A bit of cleanup. Removed bat.reuse(Map) and unexported some C functions. diffs (truncated from 577 to 300 lines): diff --git a/clients/Tests/MAL-signatures-hge.test b/clients/Tests/MAL-signatures-hge.test --- a/clients/Tests/MAL-signatures-hge.test +++ b/clients/Tests/MAL-signatures-hge.test @@ -4004,16 +4004,6 @@ command bat.replace(X_0:bat[:any_1], X_1 BKCbun_inplace_force; Replace the tail value of one BUN that has some head value. bat -reuse -command bat.reuse(X_0:bat[:any_1], X_1:bat[:oid]):bat[:any_1] -BKCreuseBAT; -Shuffle the values around to restore a dense representation of buns. -bat -reuseMap -command bat.reuseMap(X_0:bat[:any_1], X_1:bat[:oid]):bat[:oid] -BKCreuseBATmap; -Derive the oid mapping for reuse BAT based on list of to-be-deleted -bat save command bat.save(X_0:bat[:any_1]):void BKCsave2; diff --git a/clients/Tests/MAL-signatures.test b/clients/Tests/MAL-signatures.test --- a/clients/Tests/MAL-signatures.test +++ b/clients/Tests/MAL-signatures.test @@ -3429,16 +3429,6 @@ command bat.replace(X_0:bat[:any_1], X_1 BKCbun_inplace_force; Replace the tail value of one BUN that has some head value. bat -reuse -command bat.reuse(X_0:bat[:any_1], X_1:bat[:oid]):bat[:any_1] -BKCreuseBAT; -Shuffle the values around to restore a dense representation of buns. -bat -reuseMap -command bat.reuseMap(X_0:bat[:any_1], X_1:bat[:oid]):bat[:oid] -BKCreuseBATmap; -Derive the oid mapping for reuse BAT based on list of to-be-deleted -bat save command bat.save(X_0:bat[:any_1]):void BKCsave2; 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 @@ -753,10 +753,6 @@ str AUTHunlockVault(const char *password str AUTHverifyPassword(const char *passwd); str BKCmirror(bat *ret, const bat *bid); str BKCnewBAT(bat *res, const int *tt, const BUN *cap, role_t role); -str BKCreuseBAT(bat *ret, const bat *bid, const bat *did); -str BKCsetName(void *r, const bat *bid, const char *const *s); -str BKCsetPersistent(void *r, const bat *bid); -str BKCshrinkBAT(bat *ret, const bat *bid, const bat *did); str CLTsessions(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CLTshutdown(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str COPYrejects(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); diff --git a/monetdb5/ChangeLog.Dec2023 b/monetdb5/ChangeLog.Dec2023 --- a/monetdb5/ChangeLog.Dec2023 +++ b/monetdb5/ChangeLog.Dec2023 @@ -1,6 +1,9 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog +* Tue Dec 19 2023 Sjoerd Mullender <sjo...@acm.org> +- Removed MAL functions bat.reuse and bat.reuseMap. + * Wed Dec 6 2023 Sjoerd Mullender <sjo...@acm.org> - The MAL functions io.import and io.export have been removed. diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All --- a/monetdb5/mal/Tests/All +++ b/monetdb5/mal/Tests/All @@ -161,7 +161,6 @@ tst810 tst819 tst840 tst850 -tst866 tst870 tst880 tst890 diff --git a/monetdb5/mal/Tests/tst866.maltest b/monetdb5/mal/Tests/tst866.maltest deleted file mode 100644 --- a/monetdb5/mal/Tests/tst866.maltest +++ /dev/null @@ -1,76 +0,0 @@ -statement ok -function foo(); -b:= bat.new(:int); -bat.append(b,1); -bat.append(b,2); -bat.append(b,3); -bat.append(b,4); -bat.append(b,5); -bat.append(b,6); -bat.append(b,7); -bat.append(b,8); -bat.append(b,9); -io.print(b); -d:= bat.new(:oid); -bat.append(d,1@0); -bat.append(d,2@0); -bat.append(d,7@0); -io.print(d); -s:= bat.reuse(b,d); -io.print(s); -so:= bat.reuseMap(b,d); -io.print(so); -end foo; - -query II rowsort -user.foo(); ----- -0 -0 -0 -1 -0 -1 -0 -1 -1 -2 -1 -2 -1 -3 -1 -4 -2 -3 -2 -4 -2 -5 -2 -7 -3 -4 -3 -5 -3 -6 -4 -5 -4 -6 -4 -7 -5 -6 -5 -8 -5 -9 -6 -7 -7 -8 -8 -9 - diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c --- a/monetdb5/modules/kernel/bat5.c +++ b/monetdb5/modules/kernel/bat5.c @@ -447,7 +447,7 @@ BKCpersists(void *r, const bat *bid, con return MAL_SUCCEED; } -str +static str BKCsetPersistent(void *r, const bat *bid) { bit flag = TRUE; @@ -887,7 +887,7 @@ BKCisSynced(bit *ret, const bat *bid1, c /* * Role Management */ -str +static str BKCsetName(void *r, const bat *bid, const char *const *s) { BAT *b; @@ -1034,375 +1034,6 @@ BKCgetSequenceBase(oid *r, const bat *bi return MAL_SUCCEED; } -/* - * Shrinking a void-headed BAT using a list of oids to ignore. - */ -#define shrinkloop(Type) \ - do { \ - const Type *in = (Type*)bi.base; \ - Type *restrict r = (Type*)Tloc(bn, 0); \ - for (;p<q; oidx++, p++) { \ - if ( o < ol && *o == oidx ){ \ - o++; \ - } else { \ - *r++ = in[p]; \ - cnt++; \ - } \ - } \ - } while (0) - -str -BKCshrinkBAT(bat *ret, const bat *bid, const bat *did) -{ - BAT *b, *d, *bn, *bs; - BUN cnt = 0, p = 0, q; - oid oidx = 0, *o, *ol; - gdk_return res; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "bat.shrink", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); - } - if ((d = BATdescriptor(*did)) == NULL) { - BBPunfix(b->batCacheid); - throw(MAL, "bat.shrink", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); - } - bn = COLnew(0, b->ttype, BATcount(b) - BATcount(d), b->batRole); - if (bn == NULL) { - BBPunfix(b->batCacheid); - BBPunfix(d->batCacheid); - throw(MAL, "bat.shrink", SQLSTATE(HY013) MAL_MALLOC_FAIL); - } - res = BATsort(&bs, NULL, NULL, d, NULL, NULL, false, false, false); - BBPunfix(d->batCacheid); - if (res != GDK_SUCCEED) { - BBPunfix(b->batCacheid); - BBPunfix(bn->batCacheid); - throw(MAL, "bat.shrink", GDK_EXCEPTION); - } - - o = (oid *) Tloc(bs, 0); - ol = (oid *) Tloc(bs, BATcount(bs)); - - BATiter bi = bat_iterator(b); - q = bi.count; - if (ATOMvarsized(bi.type)) { - for (; p < q; oidx++, p++) { - if (o < ol && *o == oidx) { - o++; - } else { - if (BUNappend(bn, BUNtvar(bi, p), false) != GDK_SUCCEED) { - bat_iterator_end(&bi); - BBPunfix(b->batCacheid); - BBPunfix(bn->batCacheid); - throw(MAL, "bat.shrink", GDK_EXCEPTION); - } - cnt++; - } - } - } else { - uint16_t width = bi.width; - - switch (width) { - case 0: - bat_iterator_end(&bi); - BBPunfix(b->batCacheid); - BBPunfix(bn->batCacheid); - throw(MAL, "bat.shrink", - SQLSTATE(42000) "bat.shrink not available for 0 width types"); - case 1: - shrinkloop(bte); - break; - case 2: - shrinkloop(sht); - break; - case 4: - shrinkloop(int); - break; - case 8: - shrinkloop(lng); - break; -#ifdef HAVE_HGE - case 16: - shrinkloop(hge); - break; -#endif - default:{ - const int8_t *restrict src = (int8_t *) bi.base; - int8_t *restrict dst = (int8_t *) Tloc(bn, 0); - - assert(b->ttype != TYPE_oid); /* because of 'restrict', the oid case can't fall here */ - for (; p < q; oidx++, p++) { - if (o < ol && *o == oidx) { - o++; - } else { - memcpy(dst, src, width); - dst += width; - cnt++; - } - src += width; - } - } - } - } - - BATsetcount(bn, cnt); - bn->tsorted = false; - bn->trevsorted = false; - bn->tseqbase = oid_nil; - bn->tkey = bi.key; _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org