Changeset: dbf4dd64f9b1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dbf4dd64f9b1
Modified Files:
gdk/gdk_group.c
Branch: default
Log Message:
Fix grouping code.
If values are equal but their groups aren't we incorrectly produced a
group that contained both.
diffs (24 lines):
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -240,10 +240,8 @@ BATgroup_internal(BAT **groups, BAT **ex
p < q;
p++) {
v = BUNtail(bi, p);
- if ((grps && *grps++ != prev) || cmp(pv, v) != 0) {
+ if ((grps && *grps != prev) || cmp(pv, v) != 0) {
ngrp++;
- if (grps)
- prev = *grps;
if (ngrp == maxgrps) {
/* we need to extend extents
* and histo bats */
@@ -270,6 +268,8 @@ BATgroup_internal(BAT **groups, BAT **ex
}
*ngrps++ = ngrp;
pv = v;
+ if (grps)
+ prev = *grps++;
}
/* ngrp is the id of the last group, turn it into the count */
ngrp++;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list