Changeset: 179c70f922f3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=179c70f922f3
Modified Files:
monetdb5/extras/jaql/jaqlfunc.mal
Branch: Jul2012
Log Message:
jaqlfunc: make sure we select the appropriate nil-value
Sjoerd's new select code revealed a problem in the count function. We
used (v)oid nil to select lng nil from the input. We know for sure that
we get a lng bat from the caller, so we can safely use nil:lng.
diffs (17 lines):
diff --git a/monetdb5/extras/jaql/jaqlfunc.mal
b/monetdb5/extras/jaql/jaqlfunc.mal
--- a/monetdb5/extras/jaql/jaqlfunc.mal
+++ b/monetdb5/extras/jaql/jaqlfunc.mal
@@ -124,8 +124,11 @@ end avg;
# perform count over the input array
function count(v:bat[:oid,:any]):bat[:oid,:lng];
k := algebra.kunique(v);
- v := algebra.antiuselect(v, nil);
- x := aggr.count(v, k, false);
+ # the input bat v is :oid,:lng, this is guaranteed, but the function
+ # signature *must* be :oid,:any in order to indicate that the
+ # original contents (tail value) does not matter for this function
+ w := algebra.antiuselect(v, nil:lng);
+ x := aggr.count(w, k, false);
r := batcalc.lng(x);
return r;
end count;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list