Changeset: c675205e357c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c675205e357c Modified Files: monetdb5/extras/jaql/Tests/group02.mal monetdb5/extras/jaql/Tests/group02.stable.out Branch: Oct2012 Log Message:
group02: enable tests that just work fine diffs (48 lines): 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 } ] _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list