Changeset: 5f1fdcf803d8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5f1fdcf803d8
Modified Files:
sql/server/sql_mvc.c
sql/storage/bat/bat_storage.c
Branch: insertonly
Log Message:
Merge with default.
diffs (truncated from 1746 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
@@ -51033,56 +51033,6 @@ user_statistics
pattern sysmon.user_statistics() (X_0:bat[:str], X_1:bat[:lng], X_2:bat[:lng],
X_3:bat[:timestamp], X_4:bat[:timestamp], X_5:bat[:lng], X_6:bat[:str])
SYSMONstatistics;
(empty)
-tokenizer
-append
-command tokenizer.append(X_0:str):oid
-TKNZRappend;
-tokenize a new string and append it to the tokenizer (duplicate elimination is
performed)
-tokenizer
-close
-command tokenizer.close():void
-TKNZRclose;
-close the current tokenizer store
-tokenizer
-depositFile
-command tokenizer.depositFile(X_0:str):void
-TKNZRdepositFile;
-batch insertion from a file of strings to tokenize, each string is separated
by a new line
-tokenizer
-getCardinality
-command tokenizer.getCardinality():bat[:lng]
-TKNZRgetCardinality;
-debugging function that returns the unique tokens at each level
-tokenizer
-getCount
-command tokenizer.getCount():bat[:lng]
-TKNZRgetCount;
-debugging function that returns the size of the bats at each level
-tokenizer
-getIndex
-command tokenizer.getIndex():bat[:oid]
-TKNZRgetIndex;
-administrative function that returns the INDEX bat
-tokenizer
-getLevel
-command tokenizer.getLevel(X_0:int):bat[:str]
-TKNZRgetLevel;
-administrative function that returns the bat on level i
-tokenizer
-locate
-pattern tokenizer.locate(X_0:str):oid
-TKNZRlocate;
-if the given string is in the store returns its oid, otherwise oid_nil
-tokenizer
-open
-command tokenizer.open(X_0:str):void
-TKNZRopen;
-open the named tokenizer store, a new one is created if the specified name
does not exist
-tokenizer
-take
-pattern tokenizer.take(X_0:oid):str
-TKNZRtakeOid;
-reconstruct and returns the i-th string
txtsim
dameraulevenshtein
pattern txtsim.dameraulevenshtein(X_0:str, X_1:str):int
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
@@ -39358,56 +39358,6 @@ user_statistics
pattern sysmon.user_statistics() (X_0:bat[:str], X_1:bat[:lng], X_2:bat[:lng],
X_3:bat[:timestamp], X_4:bat[:timestamp], X_5:bat[:lng], X_6:bat[:str])
SYSMONstatistics;
(empty)
-tokenizer
-append
-command tokenizer.append(X_0:str):oid
-TKNZRappend;
-tokenize a new string and append it to the tokenizer (duplicate elimination is
performed)
-tokenizer
-close
-command tokenizer.close():void
-TKNZRclose;
-close the current tokenizer store
-tokenizer
-depositFile
-command tokenizer.depositFile(X_0:str):void
-TKNZRdepositFile;
-batch insertion from a file of strings to tokenize, each string is separated
by a new line
-tokenizer
-getCardinality
-command tokenizer.getCardinality():bat[:lng]
-TKNZRgetCardinality;
-debugging function that returns the unique tokens at each level
-tokenizer
-getCount
-command tokenizer.getCount():bat[:lng]
-TKNZRgetCount;
-debugging function that returns the size of the bats at each level
-tokenizer
-getIndex
-command tokenizer.getIndex():bat[:oid]
-TKNZRgetIndex;
-administrative function that returns the INDEX bat
-tokenizer
-getLevel
-command tokenizer.getLevel(X_0:int):bat[:str]
-TKNZRgetLevel;
-administrative function that returns the bat on level i
-tokenizer
-locate
-pattern tokenizer.locate(X_0:str):oid
-TKNZRlocate;
-if the given string is in the store returns its oid, otherwise oid_nil
-tokenizer
-open
-command tokenizer.open(X_0:str):void
-TKNZRopen;
-open the named tokenizer store, a new one is created if the specified name
does not exist
-tokenizer
-take
-pattern tokenizer.take(X_0:oid):str
-TKNZRtakeOid;
-reconstruct and returns the i-th string
txtsim
dameraulevenshtein
pattern txtsim.dameraulevenshtein(X_0:str, X_1:str):int
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -245,7 +245,7 @@ typedef struct bstream {
stream_export bstream *bstream_create(stream *rs, size_t chunk_size); // used
all over
stream_export void bstream_destroy(bstream *s); // all over
-stream_export ssize_t bstream_read(bstream *s, size_t size); // tablet.c,
tokenizer.c
+stream_export ssize_t bstream_read(bstream *s, size_t size); // tablet.c
stream_export ssize_t bstream_next(bstream *s); // all over
/* Callback stream is a stream where the read and write functions are
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2077,7 +2077,7 @@ BBPdir_first(bool subcommit, lng logno,
* replacing the entries for the subcommitted bats */
if ((obbpf = GDKfileopen(0, SUBDIR, "BBP", "dir", "r")) == NULL
&&
(obbpf = GDKfileopen(0, BAKDIR, "BBP", "dir", "r")) ==
NULL) {
- GDKsyserror("subcommit attempted without backup
BBP.dir.");
+ GDKsyserror("subcommit attempted without backup
BBP.dir");
goto bailout;
}
/* read first three lines */
@@ -2143,7 +2143,7 @@ BBPdir_step(bat bid, BUN size, int n, ch
}
n = -1;
if (fclose(*obbpfp) == EOF) {
- GDKsyserror("Closing backup BBP.dir file
failed.\n");
+ GDKsyserror("Closing backup BBP.dir file
failed\n");
GDKclrerr(); /* ignore error */
}
*obbpfp = NULL;
@@ -2181,7 +2181,7 @@ BBPdir_last(int n, char *buf, size_t buf
goto bailout;
}
if (fclose(obbpf) == EOF) {
- GDKsyserror("Closing backup BBP.dir file
failed.\n");
+ GDKsyserror("Closing backup BBP.dir file
failed\n");
GDKclrerr(); /* ignore error */
}
obbpf = NULL;
@@ -3902,7 +3902,7 @@ BBPsync(int cnt, bat *restrict subcommit
MT_rename(bakdir, deldir) < 0))
ret = GDK_FAIL;
if (ret != GDK_SUCCEED)
- GDKsyserror("rename(%s,%s) failed.\n", bakdir, deldir);
+ GDKsyserror("rename(%s,%s) failed\n", bakdir, deldir);
TRC_DEBUG(IO_, "rename %s %s = %d\n", bakdir, deldir, (int)
ret);
}
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -307,6 +307,8 @@ selectjoin(BAT **r1p, BAT **r2p, BAT *l,
BATiter li = bat_iterator(l);
const void *v;
BAT *bn = NULL;
+ BAT *r1 = NULL;
+ BAT *r2 = NULL;
BUN bncount;
assert(lci->ncand > 0);
@@ -354,46 +356,30 @@ selectjoin(BAT **r1p, BAT **r2p, BAT *l,
if (semi)
bncount = 1;
if (max_one) {
- BBPreclaim(bn);
GDKerror("more than one match");
- return GDK_FAIL;
+ goto bailout;
}
}
- BAT *r1 = COLnew(0, TYPE_oid, lci->ncand * bncount, TRANSIENT);
- if (r1 == NULL) {
- BBPreclaim(bn);
- return GDK_FAIL;
- }
+ r1 = COLnew(0, TYPE_oid, lci->ncand * bncount, TRANSIENT);
+ if (r1 == NULL)
+ goto bailout;
r1->tsorted = true;
r1->trevsorted = lci->ncand == 1;
r1->tseqbase = bncount == 1 && lci->tpe == cand_dense ? o : oid_nil;
r1->tkey = bncount == 1;
r1->tnil = false;
r1->tnonil = true;
- BAT *r2 = NULL;
- if (r2p) {
- if (bn)
- r2 = COLnew(0, TYPE_oid, lci->ncand * bncount,
TRANSIENT);
- else
- r2 = BATconstant(0, TYPE_void, &oid_nil, lci->ncand *
bncount, TRANSIENT);
- if (r2 == NULL) {
- BBPreclaim(bn);
- BBPreclaim(r1);
- return GDK_FAIL;
- }
- if (bn) {
- r2->tsorted = lci->ncand == 1 || bncount == 1;
- r2->trevsorted = bncount == 1;
- r2->tseqbase = lci->ncand == 1 && BATtdense(bn) ?
bn->tseqbase : oid_nil;
- r2->tkey = lci->ncand == 1;
- r2->tnil = false;
- r2->tnonil = true;
- }
- }
if (bn == NULL) {
+ /* left outer join, no match, we're returning nil in r2 */
oid *o1p = (oid *) Tloc(r1, 0);
BUN p, q = bncount;
+ if (r2p) {
+ r2 = BATconstant(0, TYPE_void, &oid_nil, lci->ncand *
bncount, TRANSIENT);
+ if (r2 == NULL)
+ goto bailout;
+ *r2p = r2;
+ }
do {
GDK_CHECK_TIMEOUT(timeoffset, counter,
GOTO_LABEL_TIMEOUT_HANDLER(bailout));
@@ -402,51 +388,65 @@ selectjoin(BAT **r1p, BAT **r2p, BAT *l,
}
o = canditer_next(lci);
} while (!is_oid_nil(o));
- } else if (BATtdense(bn)) {
- oid *o1p = (oid *) Tloc(r1, 0);
- oid *o2p = r2 ? (oid *) Tloc(r2, 0) : NULL;
- oid bno = bn->tseqbase;
- BUN p, q = bncount;
-
- do {
- GDK_CHECK_TIMEOUT(timeoffset, counter,
- GOTO_LABEL_TIMEOUT_HANDLER(bailout));
- for (p = 0; p < q; p++) {
- *o1p++ = o;
- }
- if (o2p) {
- for (p = 0; p < q; p++) {
- *o2p++ = bno + p;
- }
- }
- o = canditer_next(lci);
- } while (!is_oid_nil(o));
} else {
oid *o1p = (oid *) Tloc(r1, 0);
- oid *o2p = r2 ? (oid *) Tloc(r2, 0) : NULL;
- const oid *bnp = (const oid *) Tloc(bn, 0);
+ oid *o2p;
BUN p, q = bncount;
- do {
- GDK_CHECK_TIMEOUT(timeoffset, counter,
- GOTO_LABEL_TIMEOUT_HANDLER(bailout));
- for (p = 0; p < q; p++) {
- *o1p++ = o;
- }
- if (o2p) {
+ if (r2p) {
+ r2 = COLnew(0, TYPE_oid, lci->ncand * bncount,
TRANSIENT);
+ if (r2 == NULL)
+ goto bailout;
+ r2->tsorted = lci->ncand == 1 || bncount == 1;
+ r2->trevsorted = bncount == 1;
+ r2->tseqbase = lci->ncand == 1 && BATtdense(bn) ?
bn->tseqbase : oid_nil;
+ r2->tkey = lci->ncand == 1;
+ r2->tnil = false;
+ r2->tnonil = true;
+ *r2p = r2;
+ o2p = (oid *) Tloc(r2, 0);
+ } else {
+ o2p = NULL;
+ }
+
+ if (BATtdense(bn)) {
+ oid bno = bn->tseqbase;
+
+ do {
+ GDK_CHECK_TIMEOUT(timeoffset, counter,
+
GOTO_LABEL_TIMEOUT_HANDLER(bailout));
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]