Changeset: 7caf86ebcce7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7caf86ebcce7
Modified Files:
        gdk/gdk_bat.c
        monetdb5/extras/jaql/Tests/group02.mal
        monetdb5/extras/jaql/Tests/group02.stable.out
        monetdb5/extras/jaql/jaqltests/Tests/shred.stable.out
        monetdb5/extras/jaql/jaqltests/Tests/unroll.stable.out
Branch: default
Log Message:

Merged from Oct2012


diffs (83 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2657,8 +2657,7 @@ BATsetaccess(BAT *b, int newmode)
                storage_t b0, b1, b2 = STORE_MEM, b3 = STORE_MEM;
 
                if (b->batSharecnt && newmode != BAT_READ) {
-
-                       PROPDEBUG THRprintf(GDKout, "#BATsetaccess: %s has %d 
views; deliver a copy.\n", BATgetId(b), b->batSharecnt);
+                       BATDEBUG THRprintf(GDKout, "#BATsetaccess: %s has %d 
views; creating a copy\n", BATgetId(b), b->batSharecnt);
                        b = BATsetaccess(BATcopy(b, b->htype, b->ttype, TRUE), 
newmode);
                        if (b && b->batStamp > 0)
                                b->batStamp = -b->batStamp;     /* prevent MIL 
setaccess */
diff --git a/monetdb5/extras/jaql/Tests/group02.mal 
b/monetdb5/extras/jaql/Tests/group02.mal
--- a/monetdb5/extras/jaql/Tests/group02.mal
+++ b/monetdb5/extras/jaql/Tests/group02.mal
@@ -6,11 +6,10 @@
 jaql.x("[]->group into count($);");
 # only works when the groupkey exists for all elements
 jaql.x("[{\"a\": 1}, {\"a\": 2}]->group by d = $.a into count($);");
-#jaql.x("explain [{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into 
count($);");
-# should return 0 for groups with no matching values
-#jaql.x("[{\"a\": 1, \"b\": 5}, {\"a\": 2}]->group by d = $.a into {d, 
\"s\":sum($[*].b)};");
-#jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].a)};");
-#jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].b)};");
+jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into 
count($);");
+jaql.x("[{\"a\": 1, \"b\": 5}, {\"a\": 2}]->group by d = $.a into {d, 
\"s\":sum($[*].b)};");
+jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].a)};");
+jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].b)};");
 
 jaql.x("[[],[1,2]] -> transform {\"cnt\": count($)};");
 jaql.x("[[],[1,2]] -> transform {\"sum\": sum($)};");
diff --git a/monetdb5/extras/jaql/Tests/group02.stable.out 
b/monetdb5/extras/jaql/Tests/group02.stable.out
--- a/monetdb5/extras/jaql/Tests/group02.stable.out
+++ b/monetdb5/extras/jaql/Tests/group02.stable.out
@@ -24,17 +24,20 @@ function user.main():void;
     jaql.x("[]->group into count($);");
 # only works when the groupkey exists for all elements 
     jaql.x("[{\"a\": 1}, {\"a\": 2}]->group by d = $.a into count($);");
-#jaql.x("explain [{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into 
count($);"); 
-# should return 0 for groups with no matching values 
-#jaql.x("[{\"a\": 1, \"b\": 5}, {\"a\": 2}]->group by d = $.a into {d, 
\"s\":sum($[*].b)};"); 
-#jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].a)};"); 
-#jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].b)};"); 
+    jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into 
count($);");
+    jaql.x("[{\"a\": 1, \"b\": 5}, {\"a\": 2}]->group by d = $.a into {d, 
\"s\":sum($[*].b)};");
+    jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].a)};");
+    jaql.x("[{\"a\": 1}, {\"a\": 2}, {\"b\": 1}]->group by d = $.a into {d, 
\"c\":count($[*].b)};");
     jaql.x("[[],[1,2]] -> transform {\"cnt\": count($)};");
     jaql.x("[[],[1,2]] -> transform {\"sum\": sum($)};");
     jaql.x("[[],[1,2]] -> transform {\"avg\": avg($)};");
 end main;
 [ 0 ]
 [ 1, 1 ]
+[ 1, 1 ]
+[ { "d": 1, "s": 5 }, { "d": 2, "s": null } ]
+[ { "d": 1, "c": 1 }, { "d": 2, "c": 1 } ]
+[ { "d": 1, "c": 0 }, { "d": 2, "c": 0 } ]
 [ { "cnt": 0 }, { "cnt": 2 } ]
 [ { "sum": null }, { "sum": 3 } ]
 [ { "avg": null }, { "avg": 1.500000 } ]
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/shred.stable.out 
b/monetdb5/extras/jaql/jaqltests/Tests/shred.stable.out
--- a/monetdb5/extras/jaql/jaqltests/Tests/shred.stable.out
+++ b/monetdb5/extras/jaql/jaqltests/Tests/shred.stable.out
@@ -111,7 +111,6 @@ Ready.
   }
 ]
 #a -> expand unroll $.menu.items -> filter $.menu.items.id == "OpenNew";
-#BATsetaccess: tmp_775 has 4 views; deliver a copy.
 % .json # table_name
 % json # name
 % clob # type
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/unroll.stable.out 
b/monetdb5/extras/jaql/jaqltests/Tests/unroll.stable.out
--- a/monetdb5/extras/jaql/jaqltests/Tests/unroll.stable.out
+++ b/monetdb5/extras/jaql/jaqltests/Tests/unroll.stable.out
@@ -25,7 +25,6 @@ Ready.
 # 19:22:35 >  
 
 #a -> expand unroll $.menu.items;
-#BATsetaccess: tmp_775 has 4 views; deliver a copy.
 % .json # table_name
 % json # name
 % clob # type
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to