Changeset: 8e777c2d06aa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8e777c2d06aa
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
debian/monetdb5-server.install
gdk/ChangeLog
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/ChangeLog
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
sql/backends/monet5/sql_statement.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
Branch: default
Log Message:
merged
diffs (truncated from 884 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
@@ -681,7 +681,6 @@ stdout of test 'MAL-signatures` in direc
[ "bat", "setColumn", "command bat.setColumn(b:bat[:any_1],
t:str):void ", "BKCsetColumn;", "Give a logical name to the tail
column of a BAT." ]
[ "bat", "setHash", "command bat.setHash(b:bat[:any_1]):bit ",
"BKCsetHash;", "Create a hash structure on the column" ]
[ "bat", "setImprints", "command bat.setImprints(b:bat[:any_1]):bit ",
"BKCsetImprints;", "Create an imprints structure on the column" ]
-[ "bat", "setKey", "command bat.setKey(b:bat[:any_1],
mode:bit):bat[:any_1] ", "BKCsetkey;", "Sets the 'key' property of the
tail column to 'mode'. In 'key' mode,\n the kernel will silently block
insertions that cause a duplicate\n entry in the head column." ]
[ "bat", "setName", "command bat.setName(b:bat[:any_1], s:str):void
", "BKCsetName;", "Give a logical name to a BAT. " ]
[ "bat", "setPersistent", "command
bat.setPersistent(b:bat[:any_1]):void ", "BKCsetPersistent;", "Make
the BAT persistent." ]
[ "bat", "setTransient", "command bat.setTransient(b:bat[:any_1]):void
", "BKCsetTransient;", "Make the BAT transient. Returns \n\tboolean
which indicates if the\nBAT administration has indeed changed." ]
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
@@ -787,7 +787,6 @@ stdout of test 'MAL-signatures` in direc
[ "bat", "setColumn", "command bat.setColumn(b:bat[:any_1],
t:str):void ", "BKCsetColumn;", "Give a logical name to the tail
column of a BAT." ]
[ "bat", "setHash", "command bat.setHash(b:bat[:any_1]):bit ",
"BKCsetHash;", "Create a hash structure on the column" ]
[ "bat", "setImprints", "command bat.setImprints(b:bat[:any_1]):bit ",
"BKCsetImprints;", "Create an imprints structure on the column" ]
-[ "bat", "setKey", "command bat.setKey(b:bat[:any_1],
mode:bit):bat[:any_1] ", "BKCsetkey;", "Sets the 'key' property of the
tail column to 'mode'. In 'key' mode,\n the kernel will silently block
insertions that cause a duplicate\n entry in the head column." ]
[ "bat", "setName", "command bat.setName(b:bat[:any_1], s:str):void
", "BKCsetName;", "Give a logical name to a BAT. " ]
[ "bat", "setPersistent", "command
bat.setPersistent(b:bat[:any_1]):void ", "BKCsetPersistent;", "Make
the BAT persistent." ]
[ "bat", "setTransient", "command bat.setTransient(b:bat[:any_1]):void
", "BKCsetTransient;", "Make the BAT transient. Returns \n\tboolean
which indicates if the\nBAT administration has indeed changed." ]
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
@@ -484,7 +484,6 @@ size_t strLen(const char *s);
int strNil(const char *s);
const char str_nil[2];
gdk_return void_inplace(BAT *b, oid id, const void *val, bool force)
__attribute__((__warn_unused_result__));
-gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bool force)
__attribute__((__warn_unused_result__));
int win_mkdir(const char *, const int mode);
int win_rename(const char *, const char *);
int win_rmdir(const char *);
@@ -857,7 +856,6 @@ str BKCsetImprints(bit *ret, const bat *
str BKCsetName(void *r, const bat *bid, const char *const *s);
str BKCsetPersistent(void *r, const bat *bid);
str BKCsetTransient(void *r, const bat *bid);
-str BKCsetkey(bat *res, const bat *bid, const bit *param);
str BKCshrinkBAT(bat *ret, const bat *bid, const bat *did);
str BLOBblob_blob(blob **d, blob **s);
str BLOBblob_fromstr(blob **b, const char **d);
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,16 +1,17 @@
debian/tmp/usr/bin/mserver5 usr/bin
debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT:
lib_{bam,geom,gsl,lidar,pyapi,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT:
lib_{bam,fits,geom,gsl,lidar,pyapi*,rapi,sql}.so
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_opt_sql_append.so
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so
usr/lib/x86_64-linux-gnu/monetdb5
-# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT:
{bam,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bglprsu]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
+# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT:
{bam,fits,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfglprsu]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/ba[!m]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/b[!a]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/f[!i]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/generator.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/g[!es]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/l[!i]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog file for MonetDB
# This file is updated with Maddlog
+* Tue Dec 3 2019 Sjoerd Mullender <[email protected]>
+- Removed the tunique property. The tunique property indicated that
+ all values in the column had to be distinct. It was removed because
+ it wasn't used.
+
* Fri Nov 22 2019 Sjoerd Mullender <[email protected]>
- BATrangeselect now has two extra arguments: anti and symmetric
(both bool).
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -716,7 +716,6 @@ gdk_export int VALisnil(const ValRecord
* int ttype; // Tail type number
* str tident; // name for tail column
* bool tkey; // tail values are unique
- * bool tunique; // tail values must be kept unique
* bool tnonil; // tail has no nils
* bool tsorted; // are tail values currently ordered?
* bool tvarsized; // for speed: tail type is varsized?
@@ -755,7 +754,6 @@ typedef struct {
uint8_t shift; /* log2 of bun width */
bool varsized:1, /* varsized/void (true) or fixedsized (false) */
key:1, /* no duplicate values present */
- unique:1, /* no duplicate values allowed */
nonil:1, /* there are no nils in the column */
nil:1, /* there is a nil in the column */
sorted:1, /* column is sorted in ascending order */
@@ -822,7 +820,6 @@ typedef struct BATiter {
/* macros to hide complexity of the BAT structure */
#define ttype T.type
#define tkey T.key
-#define tunique T.unique
#define tvarsized T.varsized
#define tseqbase T.seq
#define tsorted T.sorted
@@ -2284,8 +2281,6 @@ gdk_export void GDKclrerr(void);
#include "gdk_utils.h"
/* functions defined in gdk_bat.c */
-gdk_export gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bool force)
- __attribute__((__warn_unused_result__));
gdk_export gdk_return void_inplace(BAT *b, oid id, const void *val, bool force)
__attribute__((__warn_unused_result__));
gdk_export BAT *BATattach(int tt, const char *heapfile, role_t role);
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -335,7 +335,6 @@ VIEWreset(BAT *b)
b->batRestricted = BAT_WRITE;
b->tkey = BATtkey(v);
- b->tunique = false;
/* copy the heaps */
b->theap = tail;
@@ -360,7 +359,6 @@ VIEWreset(BAT *b)
b->batDirtydesc = true;
b->tkey = BATtkey(v);
- b->tunique = false;
/* make the BAT empty and insert all again */
DELTAinit(b);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -82,7 +82,6 @@ BATcreatedesc(oid hseq, int tt, bool hea
bn->ttype = tt;
bn->tkey = false;
- bn->tunique = false;
bn->tnonil = true;
bn->tnil = false;
bn->tsorted = bn->trevsorted = ATOMlinear(tt);
@@ -963,8 +962,7 @@ setcolprops(BAT *b, const void *x)
prv = BUNtail(bi, pos - 1);
cmp = ATOMcmp(b->ttype, prv, x);
- if (!b->tunique && /* assume outside check if tunique */
- b->tkey &&
+ if (b->tkey &&
(cmp == 0 || /* definitely not KEY */
(b->batCount > 1 && /* can't guarantee KEY if unordered */
((b->tsorted && cmp > 0) ||
@@ -1040,9 +1038,6 @@ BUNappend(BAT *b, const void *t, bool fo
BATcheck(b, "BUNappend", GDK_FAIL);
assert(!VIEWtparent(b));
- if (b->tunique && BUNfnd(b, t) != BUN_NONE) {
- return GDK_SUCCEED;
- }
p = BUNlast(b); /* insert at end */
if (p == BUN_MAX || b->batCount == BUN_MAX) {
@@ -1381,7 +1376,7 @@ BUNinplace(BAT *b, BUN p, const void *t,
}
} else if (b->tnorevsorted >= p)
b->tnorevsorted = 0;
- if (((b->ttype != TYPE_void) & b->tkey & !b->tunique) && b->batCount >
1) {
+ if (((b->ttype != TYPE_void) & b->tkey) && b->batCount > 1) {
BATkey(b, false);
} else if (!b->tkey && (b->tnokey[0] == p || b->tnokey[1] == p))
b->tnokey[0] = b->tnokey[1] = 0;
@@ -1408,9 +1403,6 @@ BUNreplace(BAT *b, oid id, const void *t
if (id < b->hseqbase || id >= b->hseqbase + BATcount(b))
return GDK_SUCCEED;
- if (b->tunique && BUNfnd(b, t) != BUN_NONE) {
- return GDK_SUCCEED;
- }
if (b->ttype == TYPE_void) {
/* no need to materialize if value doesn't change */
if (is_oid_nil(b->tseqbase) ||
@@ -1433,29 +1425,11 @@ void_inplace(BAT *b, oid id, const void
GDKerror("void_inplace: id out of range\n");
return GDK_FAIL;
}
- if (b->tunique && BUNfnd(b, val) != BUN_NONE)
- return GDK_SUCCEED;
if (b->ttype == TYPE_void)
return GDK_SUCCEED;
return BUNinplace(b, id - b->hseqbase, val, force);
}
-gdk_return
-void_replace_bat(BAT *b, BAT *p, BAT *u, bool force)
-{
- BUN r, s;
- BATiter uvi = bat_iterator(u);
-
- BATloop(u, r, s) {
- oid updid = BUNtoid(p, r);
- const void *val = BUNtail(uvi, r);
-
- if (void_inplace(b, updid, val, force) != GDK_SUCCEED)
- return GDK_FAIL;
- }
- return GDK_SUCCEED;
-}
-
/*
* @- BUN Lookup
* Location of a BUN using a value should use the available indexes to
@@ -1607,7 +1581,6 @@ BATkey(BAT *b, bool flag)
{
BATcheck(b, "BATkey", GDK_FAIL);
assert(b->batCacheid > 0);
- assert(!b->tunique || flag);
if (b->ttype == TYPE_void) {
if (BATtdense(b) && !flag) {
GDKerror("BATkey: dense column must be unique.\n");
@@ -2146,11 +2119,6 @@ BATmode(BAT *b, bool transient)
* nokey Pair of BUN positions that proof not all values are
* distinct (i.e. values at given locations are equal).
*
- * In addition there is a property "unique" that, when set, indicates
- * that values must be kept unique (and hence that the "key" property
- * must be set). This property is only used when changing (adding,
- * replacing) values.
- *
* Note that the functions BATtseqbase and BATkey also set more
* properties than you might suspect. When setting properties on a
* newly created and filled BAT, you may want to first make sure the
@@ -2187,7 +2155,6 @@ BATassertProps(BAT *b)
assert(b->ttype >= TYPE_void);
assert(b->ttype < GDKatomcnt);
assert(b->ttype != TYPE_bat);
- assert(!b->tunique || b->tkey); /* if unique, then key */
assert(isVIEW(b) ||
b->ttype == TYPE_void ||
BBPfarms[b->theap.farmid].roles & (1 << b->batRole));
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -478,8 +478,6 @@ append_varsized_bat(BAT *b, BAT *n, BAT
return GDK_SUCCEED;
bunins_failed:
- if (b->tunique)
- BBPunfix(s->batCacheid);
return GDK_FAIL;
}
@@ -515,44 +513,17 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
}
}
- if (b->tunique) {
- /* if b has the unique bit set, only insert values
- * from n that don't already occur in b, and make sure
- * we don't insert any duplicates either; we do this
- * by calculating a subset of n that complies with
- * this */
- BAT *d;
-
- d = BATdiff(n, b, s, NULL, true, false, BUN_NONE);
- if (d == NULL)
- return GDK_FAIL;
- s = BATunique(n, d);
- BBPunfix(d->batCacheid);
- if (s == NULL)
- return GDK_FAIL;
- if (BATcount(s) == 0) {
- /* no new values in subset of n */
- BBPunfix(s->batCacheid);
- return GDK_SUCCEED;
- }
- }
-
cnt = canditer_init(&ci, n, s);
if (cnt == 0) {
- assert(!b->tunique);
return GDK_SUCCEED;
}
if (BUNlast(b) + cnt > BUN_MAX) {
- if (b->tunique)
- BBPunfix(s->batCacheid);
GDKerror("BATappend: combined BATs too large\n");
return GDK_FAIL;
}
if (b->hseqbase + BATcount(b) + cnt >= GDK_oid_max) {
- if (b->tunique)
- BBPunfix(s->batCacheid);
GDKerror("BATappend: overflow of head value\n");
return GDK_FAIL;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list