Changeset: 4e96cf407ef1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/4e96cf407ef1 Modified Files: clients/Tests/MAL-signatures-hge.test clients/Tests/exports.stable.out gdk/gdk_join.c Branch: groupjoin Log Message:
Some fixes to new markjoin code. diffs (100 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 @@ -3495,6 +3495,16 @@ PCRElikeselect; Select all head values of the first input BAT for which the@tail value is "like" the given (SQL-style) pattern and for@which the head value occurs in the tail of the second input@BAT.@Input is a dense-headed BAT, output is a dense-headed BAT with in@the tail the head value of the input BAT for which the@relationship holds. The output BAT is sorted on the tail value. algebra markjoin +command algebra.markjoin(X_0:bat[:any_1], X_1:bat[:any_1], X_2:bat[:oid], X_3:bat[:oid], X_4:lng) (X_5:bat[:oid], X_6:bat[:bit]) +ALGmark2join; +Mark join with candidate lists +algebra +markjoin +command algebra.markjoin(X_0:bat[:any_1], X_1:bat[:any_1], X_2:bat[:oid], X_3:bat[:oid], X_4:lng) (X_5:bat[:oid], X_6:bat[:oid], X_7:bat[:bit]) +ALGmark3join; +Mark join with candidate lists +algebra +markjoin command algebra.markjoin(X_0:bat[:any_1], X_1:bat[:any_1], X_2:bat[:oid], X_3:bat[:oid], X_4:bit, X_5:lng) (X_6:bat[:oid], X_7:bat[:bit]) ALGmarkjoin; Left mark join with candidate lists, produces left output and mark flag; 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 @@ -159,6 +159,7 @@ BAT *BATintersectcand(BAT *a, BAT *b); gdk_return BATjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__)); gdk_return BATkey(BAT *b, bool onoff); gdk_return BATleftjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATmarkjoin(BAT **r1p, BAT **r2p, BAT **r3p, BAT *l, BAT *r, BAT *sl, BAT *sr, BUN estimate) __attribute__((__warn_unused_result__)); BAT *BATmaskedcands(oid hseq, BUN nr, BAT *masked, bool selected); void *BATmax(BAT *b, void *aggr); void *BATmax_skipnil(BAT *b, void *aggr, bit skipnil); diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c --- a/gdk/gdk_join.c +++ b/gdk/gdk_join.c @@ -110,11 +110,11 @@ joininitresults(BAT **r1p, BAT **r2p, BA bool lkey, bool rkey, bool semi, bool nil_on_miss, bool only_misses, bool min_one, BUN estimate) { - BAT *r1, *r2, *r3; + BAT *r1 = NULL, *r2 = NULL, *r3 = NULL; BUN maxsize, size; /* if nil_on_miss is set, we really need a right output */ - assert(!nil_on_miss || r2p != NULL); + assert(!nil_on_miss || r2p != NULL || r3p != NULL); lkey |= lcnt <= 1; rkey |= rcnt <= 1; @@ -2176,6 +2176,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3 while (lci->next < lci->ncand) { GDK_CHECK_TIMEOUT(timeoffset, counter, GOTO_LABEL_TIMEOUT_HANDLER(bailout)); + bit mark = defmark; if (lscan == 0) { /* always search r completely */ assert(equal_order); @@ -2357,6 +2358,9 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3 /* v is nil and nils don't match anything, set * to NULL to indicate nil */ v = NULL; + mark = bit_nil; + if (r3) + r3->tnil = true; } /* First we find the "first" value in r that is "at @@ -2695,10 +2699,10 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3 /* finally the mark output */ if (r3) { if (insert_nil) { - r3->tnil = rhasnil; + r3->tnil |= rhasnil; for (i = 0; i < nl; i++) { for (j = 0; j < nr; j++) { - ((bit *) r3->theap->base)[r3->batCount++] = defmark; + ((bit *) r3->theap->base)[r3->batCount++] = mark; } } } else { @@ -3288,6 +3292,11 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p r2->tseqbase = 0; } } + if (r3) { + r3->tnonil = !r3->tnil; + BATsetcount(r3, BATcount(r3)); + assert(BATcount(r1) == BATcount(r3)); + } if (BATcount(r1) > 0) { if (BATtdense(r1)) r1->tseqbase = ((oid *) r1->theap->base)[0]; @@ -4067,7 +4076,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT **r3p /* only_misses implies left output only */ assert(!only_misses || r2p == NULL); /* if nil_on_miss is set, we really need a right output */ - assert(!nil_on_miss || r2p != NULL); + assert(!nil_on_miss || r2p != NULL || r3p != NULL); /* if not_in is set, then so is only_misses */ assert(!not_in || only_misses); /* if r3p is set, then so is nil_on_miss */ _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org