Changeset: d0ffd80c004e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d0ffd80c004e
Modified Files:
gdk/gdk.h
gdk/gdk_aggr.c
gdk/gdk_atoms.c
gdk/gdk_atoms.h
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_calc.c
gdk/gdk_calc_convert.c
gdk/gdk_value.c
geom/monetdb5/geom.c
geom/monetdb5/geom_atoms.c
geom/monetdb5/geom_atoms.h
monetdb5/mal/mal_atom.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_prelude.c
monetdb5/mal/mel.h
monetdb5/modules/atoms/inet.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/tablet.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_remap.c
sql/backends/monet5/UDF/pyapi3/conversion3.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_subquery.c
sql/server/rel_optimizer.c
sql/server/rel_propagate.c
sql/server/sql_atom.c
sql/storage/bat/bat_storage.c
sql/storage/sql_catalog.c
Branch: resource_management
Log Message:
Merge with default branch.
diffs (truncated from 3887 to 300 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -944,12 +944,12 @@ BATsettrivprop(BAT *b)
b->tmaxpos = 0;
}
b->tseqbase = sqbs;
- } else if ((b->tvheap
- ? ATOMcmp(b->ttype,
- b->tvheap->base +
VarHeapVal(Tloc(b, 0), 0, b->twidth),
- ATOMnilptr(b->ttype))
- : ATOMcmp(b->ttype, Tloc(b, 0),
- ATOMnilptr(b->ttype))) == 0) {
+ } else if (b->tvheap
+ ? ATOMeq(b->ttype,
+ b->tvheap->base +
VarHeapVal(Tloc(b, 0), 0, b->twidth),
+ ATOMnilptr(b->ttype))
+ : ATOMeq(b->ttype, Tloc(b, 0),
+ ATOMnilptr(b->ttype))) {
/* the only value is NIL */
b->tminpos = BUN_NONE;
b->tmaxpos = BUN_NONE;
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -3078,7 +3078,7 @@ BATgroupcount(allocator *ma, BAT *b, BAT
BAT *bn = NULL;
int t;
const void *nil;
- int (*atomcmp)(const void *, const void *);
+ bool (*atomeq)(const void *, const void *);
struct canditer ci;
const char *err;
lng t0 = 0;
@@ -3136,7 +3136,7 @@ BATgroupcount(allocator *ma, BAT *b, BAT
} else {
t = b->ttype;
nil = ATOMnilptr(t);
- atomcmp = ATOMcompare(t);
+ atomeq = ATOMequal(t);
t = ATOMbasetype(t);
bi = bat_iterator(b);
@@ -3174,7 +3174,7 @@ BATgroupcount(allocator *ma, BAT *b, BAT
gid = gids[i] - min;
else
gid = (oid) i;
- if ((*atomcmp)(BUNtail(bi, i), nil) !=
0) {
+ if (!(*atomeq)(BUNtail(bi, i), nil)) {
cnts[gid]++;
}
}
@@ -3254,6 +3254,7 @@ do_groupmin(oid *restrict oids, BATiter
BUN i, nils;
int t;
const void *nil;
+ bool (*atomeq)(const void *, const void *);
int (*atomcmp)(const void *, const void *);
QryCtx *qry_ctx = MT_thread_get_qry_ctx();
@@ -3266,6 +3267,7 @@ do_groupmin(oid *restrict oids, BATiter
t = bi->b->ttype;
nil = ATOMnilptr(t);
+ atomeq = ATOMequal(t);
atomcmp = ATOMcompare(t);
t = ATOMbasetype(t);
oid hseq = bi->b->hseqbase;
@@ -3326,7 +3328,7 @@ do_groupmin(oid *restrict oids, BATiter
TIMEOUT_LOOP(ci->ncand, qry_ctx) {
i = canditer_next(ci) - hseq;
if (!skip_nils ||
- (*atomcmp)(BUNtail(*bi, i), nil) != 0) {
+ !(*atomeq)(BUNtail(*bi, i), nil)) {
oids[gid] = i + hseq;
nils--;
}
@@ -3340,15 +3342,14 @@ do_groupmin(oid *restrict oids, BATiter
const void *v = BUNtail(*bi, i);
if (gids)
gid = gids[i] - min;
- if (!skip_nils ||
- (*atomcmp)(v, nil) != 0) {
+ if (!skip_nils || !(*atomeq)(v, nil)) {
if (is_oid_nil(oids[gid])) {
oids[gid] = i + hseq;
nils--;
} else if (t != TYPE_void) {
const void *g =
BUNtail(*bi, (BUN) (oids[gid] - hseq));
- if ((*atomcmp)(g, nil)
!= 0 &&
- ((*atomcmp)(v, nil)
== 0 ||
+ if (!(*atomeq)(g, nil)
&&
+ ((*atomeq)(v, nil)
||
LT((*atomcmp)(v,
g), 0)))
oids[gid] = i +
hseq;
}
@@ -3377,6 +3378,7 @@ do_groupmax(oid *restrict oids, BATiter
int t;
const void *nil;
int (*atomcmp)(const void *, const void *);
+ bool (*atomeq)(const void *, const void *);
QryCtx *qry_ctx = MT_thread_get_qry_ctx();
@@ -3389,6 +3391,7 @@ do_groupmax(oid *restrict oids, BATiter
t = bi->b->ttype;
nil = ATOMnilptr(t);
atomcmp = ATOMcompare(t);
+ atomeq = ATOMequal(t);
t = ATOMbasetype(t);
oid hseq = bi->b->hseqbase;
@@ -3447,7 +3450,7 @@ do_groupmax(oid *restrict oids, BATiter
TIMEOUT_LOOP(ci->ncand, qry_ctx) {
i = canditer_next(ci) - hseq;
if (!skip_nils ||
- (*atomcmp)(BUNtail(*bi, i), nil) != 0) {
+ !(*atomeq)(BUNtail(*bi, i), nil)) {
oids[gid] = i + hseq;
nils--;
}
@@ -3461,16 +3464,15 @@ do_groupmax(oid *restrict oids, BATiter
const void *v = BUNtail(*bi, i);
if (gids)
gid = gids[i] - min;
- if (!skip_nils ||
- (*atomcmp)(v, nil) != 0) {
+ if (!skip_nils || !(*atomeq)(v, nil)) {
if (is_oid_nil(oids[gid])) {
oids[gid] = i + hseq;
nils--;
} else {
const void *g =
BUNtail(*bi, (BUN) (oids[gid] - hseq));
if (t == TYPE_void ||
- ((*atomcmp)(g, nil)
!= 0 &&
- ((*atomcmp)(v,
nil) == 0 ||
+ (!(*atomeq)(g, nil)
&&
+ ((*atomeq)(v, nil)
||
GT((*atomcmp)(v,
g), 0))))
oids[gid] = i +
hseq;
}
@@ -3756,14 +3758,14 @@ BATmax_skipnil(allocator *alloc, BAT *b,
if (BATordered(b)) {
pos = bi.count - 1 + b->hseqbase;
if (skipnil && !bi.nonil &&
- ATOMcmp(bi.type, BUNtail(bi, bi.count - 1),
- ATOMnilptr(bi.type)) == 0)
+ ATOMeq(bi.type, BUNtail(bi, bi.count - 1),
+ ATOMnilptr(bi.type)))
pos = oid_nil; /* no non-nil values */
} else if (BATordered_rev(b)) {
pos = b->hseqbase;
if (skipnil && !bi.nonil &&
- ATOMcmp(bi.type, BUNtail(bi, 0),
- ATOMnilptr(bi.type)) == 0)
+ ATOMeq(bi.type, BUNtail(bi, 0),
+ ATOMnilptr(bi.type)))
pos = oid_nil; /* no non-nil values */
} else {
if (BATcheckorderidx(b)) {
@@ -3800,7 +3802,7 @@ BATmax_skipnil(allocator *alloc, BAT *b,
res = BUNtail(bi, z - b->hseqbase);
- if (ATOMcmp(bi.type, res,
ATOMnilptr(bi.type)) == 0)
+ if (ATOMeq(bi.type, res,
ATOMnilptr(bi.type)))
pos = z;
}
HEAPdecref(oidxh, false);
@@ -3898,7 +3900,7 @@ doBATgroupquantile(allocator *ma, BAT *b
const void *nil = ATOMnilptr(tp);
const void *dnil = nil;
dbl val; /* only used for average */
- int (*atomcmp)(const void *, const void *) = ATOMcompare(tp);
+ bool (*atomeq)(const void *, const void *) = ATOMequal(tp);
const char *err;
lng t0 = 0;
@@ -4068,7 +4070,7 @@ doBATgroupquantile(allocator *ma, BAT *b
assert(qindex >= r && qindex < p);
v = BUNtail(bi, qindex);
if (!skip_nils && !bi.nonil)
- nils += (*atomcmp)(v, dnil) == 0;
+ nils += (*atomeq)(v, dnil);
}
while (min < prev) {
if (bunfastapp_nocheck(bn, dnil) != GDK_SUCCEED)
@@ -4193,7 +4195,7 @@ doBATgroupquantile(allocator *ma, BAT *b
else
index = index + t1->tseqbase;
v = BUNtail(bi, index);
- nils += (*atomcmp)(v, dnil) == 0;
+ nils += (*atomeq)(v, dnil);
}
if (oidxh != NULL)
HEAPdecref(oidxh, false);
diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -137,12 +137,12 @@ GDKanalyticaldiff(BAT *b, BAT *p, const
break;
default:{
const void *v = BUNtail(bi, 0), *next;
- int (*atomcmp) (const void *, const void *) = ATOMcompare(tpe);
+ bool (*atomeq) (const void *, const void *) = ATOMequal(tpe);
if (np) {
for (i = 0; i < cnt; i++) {
rb[i] = np[i];
next = BUNtail(bi, i);
- if (atomcmp(v, next) != 0) {
+ if (!atomeq(v, next)) {
rb[i] = TRUE;
v = next;
}
@@ -151,7 +151,7 @@ GDKanalyticaldiff(BAT *b, BAT *p, const
for (i = 0; i < cnt; i++) {
rb[i] = npb;
next = BUNtail(bi, i);
- if (atomcmp(v, next) != 0) {
+ if (!atomeq(v, next)) {
rb[i] = TRUE;
v = next;
}
@@ -159,7 +159,7 @@ GDKanalyticaldiff(BAT *b, BAT *p, const
} else {
for (i = 0; i < cnt; i++) {
next = BUNtail(bi, i);
- if (atomcmp(v, next) != 0) {
+ if (!atomeq(v, next)) {
rb[i] = TRUE;
v = next;
} else {
@@ -778,7 +778,7 @@ GDKanalyticalpeers(BAT *b, BAT *p, bool
break;
default: {
const void *prev, *next;
- int (*atomcmp) (const void *, const void *) =
ATOMcompare(bi.type);
+ bool (*atomeq) (const void *, const void *) =
ATOMequal(bi.type);
if (preceding) {
if (p) {
@@ -788,7 +788,7 @@ GDKanalyticalpeers(BAT *b, BAT *p, bool
l = j;
for (; k < i; k++) {
next = BUNtail(bi, k);
- if (atomcmp(prev, next)
!= 0) {
+ if (!atomeq(prev,
next)) {
for ( ; j < k ;
j++)
rb[j] =
l;
l = j;
@@ -805,7 +805,7 @@ GDKanalyticalpeers(BAT *b, BAT *p, bool
l = j;
for (; k < i; k++) {
next = BUNtail(bi, k);
- if (atomcmp(prev, next) != 0) {
+ if (!atomeq(prev, next)) {
for ( ; j < k ; j++)
rb[j] = l;
l = j;
@@ -821,7 +821,7 @@ GDKanalyticalpeers(BAT *b, BAT *p, bool
prev = BUNtail(bi, k);
for (; k < i; k++) {
next = BUNtail(bi, k);
- if (atomcmp(prev, next)
!= 0) {
+ if (!atomeq(prev,
next)) {
l += k - j;
for ( ; j < k ;
j++)
rb[j] =
l;
@@ -838,7 +838,7 @@ GDKanalyticalpeers(BAT *b, BAT *p, bool
prev = BUNtail(bi, k);
for (; k < i; k++) {
next = BUNtail(bi, k);
- if (atomcmp(prev, next) != 0) {
+ if (!atomeq(prev, next)) {
l += k - j;
for ( ; j < k ; j++)
rb[j] = l;
diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -244,7 +244,7 @@ GDKanalyticalfirst(BAT *b, BAT *s, BAT *
oid k = 0, cnt = BATcount(b);
const oid *restrict start = si.base, *restrict end = ei.base;
const void *nil = ATOMnilptr(tpe);
- int (*atomcmp)(const void *, const void *) = ATOMcompare(tpe);
+ bool (*atomeq)(const void *, const void *) = ATOMequal(tpe);
switch (ATOMbasetype(tpe)) {
case TYPE_bte:
@@ -281,7 +281,7 @@ GDKanalyticalfirst(BAT *b, BAT *s, BAT *
bat_iterator_end(&ei);
return NULL;
}
- has_nils |= atomcmp(curval, nil) == 0;
+ has_nils |= atomeq(curval, nil);
}
} else {
uint16_t width = r->twidth;
@@ -290,7 +290,7 @@ GDKanalyticalfirst(BAT *b, BAT *s, BAT *
const void *curval = (end[k] > start[k]) ?
BUNtloc(bi, start[k]) : nil;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]