Changeset: 29a1d7feec01 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/29a1d7feec01
Modified Files:
gdk/gdk_project.c
Branch: Jul2021
Log Message:
Make sure the output type of project chain is the same as the input.
This fixes the TestWeb assertion error.
diffs (65 lines):
diff --git a/gdk/gdk_project.c b/gdk/gdk_project.c
--- a/gdk/gdk_project.c
+++ b/gdk/gdk_project.c
@@ -371,7 +371,7 @@ project_any(BAT *restrict bn, BAT *restr
}
static BAT *
-project_str(BAT *restrict l, struct canditer *restrict ci,
+project_str(BAT *restrict l, struct canditer *restrict ci, int tpe,
BAT *restrict r1, BAT *restrict r2,
BATiter *restrict r1i, BATiter *restrict r2i,
lng t0)
@@ -386,7 +386,7 @@ project_str(BAT *restrict l, struct cand
var_t v;
BATiter *ri;
- if ((bn = COLnew(l->hseqbase, TYPE_str, ci ? ci->ncand : BATcount(l),
+ if ((bn = COLnew(l->hseqbase, tpe, ci ? ci->ncand : BATcount(l),
TRANSIENT)) == NULL)
return NULL;
@@ -591,7 +591,7 @@ BATproject2(BAT *restrict l, BAT *restri
BAT *or1 = r1, *or2 = r2, *ol = l;
oid lo, hi;
gdk_return res;
- int tpe = ATOMtype(r1->ttype);
+ int tpe = ATOMtype(r1->ttype), otpe = tpe;
bool stringtrick = false;
BUN lcount = BATcount(l);
struct canditer ci, *lci = NULL;
@@ -690,7 +690,7 @@ BATproject2(BAT *restrict l, BAT *restri
* vheap; this also means that for this case we
* don't care about duplicate elimination: it
* will remain the same */
- bn = project_str(l, lci, r1, r2, &r1i, &r2i, t0);
+ bn = project_str(l, lci, tpe, r1, r2, &r1i, &r2i, t0);
bat_iterator_end(&r1i);
bat_iterator_end(&r2i);
return bn;
@@ -787,7 +787,7 @@ BATproject2(BAT *restrict l, BAT *restri
} else {
/* make copy of string heap */
bn->tvheap->parentid = bn->batCacheid;
- bn->tvheap->farmid = BBPselectfarm(bn->batRole,
TYPE_str, varheap);
+ bn->tvheap->farmid = BBPselectfarm(bn->batRole, otpe,
varheap);
strconcat_len(bn->tvheap->filename,
sizeof(bn->tvheap->filename),
BBP_physical(bn->batCacheid), ".theap",
@@ -965,14 +965,14 @@ BATprojectchain(BAT **bats)
bi = bat_iterator(b);
if (nonil && ATOMstorage(tpe) == TYPE_str && b->batRestricted ==
BAT_READ) {
stringtrick = true;
- tpe = bi.width == 1 ? TYPE_bte : (bi.width == 2 ? TYPE_sht :
(bi.width == 4 ? TYPE_int : TYPE_lng));
- bn = COLnew_intern(ba[0].hlo, TYPE_str, ba[0].cnt, TRANSIENT,
bi.width);
+ bn = COLnew_intern(ba[0].hlo, tpe, ba[0].cnt, TRANSIENT,
bi.width);
if (bn && bn->tvheap) {
/* no need to remove any files since they were
* never created for this bat */
HEAPdecref(bn->tvheap, false);
bn->tvheap = NULL;
}
+ tpe = bi.width == 1 ? TYPE_bte : (bi.width == 2 ? TYPE_sht :
(bi.width == 4 ? TYPE_int : TYPE_lng));
} else {
bn = COLnew(ba[0].hlo, tpe, ba[0].cnt, TRANSIENT);
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list