Changeset: 997f9eed918b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=997f9eed918b
Modified Files:
        gdk/gdk_batop.c
Branch: Jul2015
Log Message:

Improve test for single group (sub)sort.
The new sorted bat may be ordered, even though there might be multiple
groups, so we can't use that to determine whether there is a single
group.


diffs (20 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1487,10 +1487,12 @@ BATsubsort(BAT **sorted, BAT **order, BA
        if (groups) {
                if (BATgroup_internal(groups, NULL, NULL, bn, g, NULL, NULL, 1) 
!= GDK_SUCCEED)
                        goto error;
-               if ((*groups)->tkey && (bn->tsorted || bn->trevsorted)) {
-                       /* if new groups bat is key and the result bat
-                        * is (rev)sorted (single input group), we
-                        * know it is key */
+               if ((*groups)->tkey &&
+                   (g == NULL || (g->tsorted && g->trevsorted))) {
+                       /* if new groups bat is key and the input
+                        * group bat has a single value (both sorted
+                        * and revsorted), we know the result bat is
+                        * key */
                        bn->tkey = 1;
                }
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to