Changeset: 6f622ccb4091 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f622ccb4091 Modified Files: monetdb5/mal/Tests/blkjoin.mal monetdb5/mal/Tests/tst201.mal monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/algebra.mal monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/bat5.mal monetdb5/modules/mal/Tests/inspect05.stable.out.int128 monetdb5/modules/mal/mat.c monetdb5/modules/mal/mat.h monetdb5/modules/mal/mat.mal monetdb5/optimizer/opt_cluster.c monetdb5/optimizer/opt_emptySet.c monetdb5/optimizer/opt_mapreduce.c monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h monetdb5/optimizer/opt_support.c monetdb5/tests/suite_00/Tests/test_50.mal Branch: resultset Log Message:
merge with default. diffs (truncated from 932 to 300 lines): diff --git a/monetdb5/mal/Tests/blkjoin.mal b/monetdb5/mal/Tests/blkjoin.mal --- a/monetdb5/mal/Tests/blkjoin.mal +++ b/monetdb5/mal/Tests/blkjoin.mal @@ -150,7 +150,7 @@ lb2:= nil; #bat.save(rb2); ## what if you sort first #t0:= alarm.usec(); -#s1 := algebra.sortTail(lb2); +#s1 := algebra.sort(lb2); #t1:= alarm.usec(); #d0:= t1-t0; #d1:= d0; @@ -158,7 +158,7 @@ lb2:= nil; #lb2 := nil; #bat.save(s1); #t0:= alarm.usec(); -#s2 := algebra.sortTail(rb2); +#s2 := algebra.sort(rb2); #t1:= alarm.usec(); #d0:= t1-t0; #d1:= d1+d0; diff --git a/monetdb5/mal/Tests/tst201.mal b/monetdb5/mal/Tests/tst201.mal --- a/monetdb5/mal/Tests/tst201.mal +++ b/monetdb5/mal/Tests/tst201.mal @@ -1,115 +1,73 @@ -# Mil compiler Version 1.0) -# Copyright (c) 1993-2001, CWI. All rights reserved. - -# Predefined code segment v0:= calc.oid(20000000); v1:= calc.setoid(v0); -#setoid(oid(20000000)); -##test basic functionality of the BAT library. -##focussed on strings -##it includes bat.insertions,deletions,selections, and joins. -# v2:= bat.new(:oid,:str); b := v2; -#b:= new(str,int); + v3:= bat.append(b,"the"); -#b.append("the",1); v4:= bat.append(b,"quick"); -#b.append("quick",2); v5:= bat.append(b,"brown"); -#b.append("brown",3); v6:= bat.append(b,"fox"); -#b.append("fox",4); v7:= bat.append(b,"jumps"); -#b.append("jumps",5); v8:= bat.append(b,"over"); -#b.append("over",6); v9:= bat.append(b,"lazy"); -#b.append("lazy",7); v10:= bat.append(b,"dog"); -#b.append("dog",8); v11:= calc.str(nil); v12:= bat.append(b,v11); -#b.append(str(nil),9); v13:= bat.append(b,"."); -#b.append(".",10); v15:= bat.append(b,""); -#b.append("",int(nil)); v16:= calc.str(nil); v18:= bat.append(b,v16); -#b.append(str(nil),int(nil)); v19:= io.print(b); -#b.print; -# -# -## Testing simple retrievals - br := bat.reverse(b); - v20:= algebra.find(br,"the"); + + v20:= algebra.find(b,"the"); v21:= io.print(v20); -#b.find("the").print; - v22:= algebra.find(br,"fox"); + + v22:= algebra.find(b,"fox"); v23:= io.print(v22); -#b.find("fox").print; + v24:= calc.str(nil); - v25:= algebra.find(br,v24); + v25:= algebra.find(b,v24); v26:= io.print(v25); -#b.find(str(nil)).print; -## This should cause an error - v27:= algebra.find(br,"cat"); + + v27:= algebra.find(b,"cat"); v28:= io.print(v27); catch MALException:str; io.print(MALException); exit MALException; -#b.find("cat").print; -# -## Can we bat.delete them and re-append them later on - v29:= bat.delete(br,"fox"); -#b.delete("fox",4); - v30:= bat.delete(br,"the"); -#b.delete("the",1); - v31:= bat.delete(br,"."); -#b.delete(".",10); - v32:= io.print(br); -#b.print; -# - b:= bat.reverse(br); + + v29:= bat.delete(b,"fox"); + v30:= bat.delete(b,"the"); + v31:= bat.delete(b,"."); + v32:= io.print(b); + + v33:= bat.append(b,"fox"); -#b.append("fox",4); v34:= bat.append(b,"the"); -#b.append("the",1); v35:= bat.append(b,"."); -#b.append(".",10); + v36:= aggr.count(b); v37:= io.print(v36); -#b.count.print; -# -## Lets cut out a few sections - br:= bat.reverse(b); + v38:= algebra.slice(b,2@0,4@0); v39:= io.print(v38); -#b.select(2,4).print; + v40:= calc.oid(nil); v41:= algebra.slice(b,7@0,v40); v42:= io.print(v41); -#b.select(7,int(nil)).print; + v43:= calc.oid(nil); v44:= calc.oid(nil); v45:= algebra.slice(b,v43,v44); v46:= io.print(v45); -#b.select(int(nil),int(nil)).print; -# -# -## testing the algebra.like command + v75:= algebra.like(b,"ox"); v76:= io.print(v75); -#b.reverse.like("ox").print; + v78:= algebra.like(b,"fo"); v79:= io.print(v78); -#b.reverse.like("fo").print; + v81:= algebra.like(b,"fox"); v82:= io.print(v81); -#b.reverse.like("fox").print; + v84:= algebra.like(b," fox"); v85:= io.print(v84); -#b.reverse.like(" fox").print; -#quit; diff --git a/monetdb5/modules/kernel/algebra.c b/monetdb5/modules/kernel/algebra.c --- a/monetdb5/modules/kernel/algebra.c +++ b/monetdb5/modules/kernel/algebra.c @@ -1444,101 +1444,6 @@ ALGtsort_rev(bat *result, const bat *bid } str -ALGhsort(bat *result, const bat *bid) -{ - BAT *b, *bn; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "algebra.hsort", RUNTIME_OBJECT_MISSING); - } - bn = BATsort(b); - if (bn) { - if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); - *result = bn->batCacheid; - BBPkeepref(*result); - BBPunfix(b->batCacheid); - return MAL_SUCCEED; - } - BBPunfix(b->batCacheid); - throw(MAL, "algebra.hsort", GDK_EXCEPTION); -} - -str -ALGhsort_rev(bat *result, const bat *bid) -{ - BAT *b, *bn; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "algebra.tsort", RUNTIME_OBJECT_MISSING); - } - bn = BATsort_rev(b); - if (bn) { - if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); - *result = bn->batCacheid; - BBPkeepref(*result); - BBPunfix(b->batCacheid); - return MAL_SUCCEED; - } - BBPunfix(b->batCacheid); - throw(MAL, "algebra.tsort", GDK_EXCEPTION); -} -str -ALGhtsort(bat *result, const bat *lid) -{ - BAT *b, *bm = NULL, *bn = NULL; - - if ((b = BATdescriptor(*lid)) == NULL) { - throw(MAL, "algebra.htsort", RUNTIME_OBJECT_MISSING); - } - bm = BATmirror(BATsort(BATmirror(b))); - if (bm) { - bn = BATssort(bm); - if (bn) { - if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); - *result = bn->batCacheid; - BBPkeepref(*result); - BBPunfix(bm->batCacheid); - BBPunfix(b->batCacheid); - return MAL_SUCCEED; - } - BBPunfix(bm->batCacheid); - BBPunfix(b->batCacheid); - throw(MAL, "algebra.htsort", GDK_EXCEPTION); - } - BBPunfix(b->batCacheid); - throw(MAL, "algebra.htsort", GDK_EXCEPTION); -} - -str -ALGthsort(bat *result, const bat *lid) -{ - BAT *b, *bm = NULL, *bn = NULL; - - if ((b = BATdescriptor(*lid)) == NULL) { - throw(MAL, "algebra.thsort", RUNTIME_OBJECT_MISSING); - } - bm = BATmirror(BATsort(b)); - if (bm) { - bn = BATssort(bm); - if (bn) { - bn = BATmirror(bn); - if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); - *result = bn->batCacheid; - BBPkeepref(*result); - BBPunfix(bm->batCacheid); - BBPunfix(b->batCacheid); - return MAL_SUCCEED; - } - BBPunfix(bm->batCacheid); - BBPunfix(b->batCacheid); - throw(MAL, "algebra.thsort", GDK_EXCEPTION); - } - BBPunfix(b->batCacheid); - throw(MAL, "algebra.thsort", GDK_EXCEPTION); -} - - -str ALGsubsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *stable) { BAT *bn = NULL, *on = NULL, *gn = NULL; diff --git a/monetdb5/modules/kernel/algebra.h b/monetdb5/modules/kernel/algebra.h --- a/monetdb5/modules/kernel/algebra.h +++ b/monetdb5/modules/kernel/algebra.h @@ -100,10 +100,6 @@ algebra_export str ALGsample(bat *result algebra_export str ALGtsort(bat *result, const bat *bid); algebra_export str ALGtsort_rev(bat *result, const bat *bid); -algebra_export str ALGhsort(bat *result, const bat *bid); -algebra_export str ALGhsort_rev(bat *result, const bat *bid); -algebra_export str ALGhtsort(bat *result, const bat *lid); -algebra_export str ALGthsort(bat *result, const bat *lid); algebra_export str ALGssort(bat *result, const bat *bid); algebra_export str ALGssort_rev(bat *result, const bat *bid); algebra_export str ALGsubsort11(bat *result, const bat *bid, const bit *reverse, const bit *stable); diff --git a/monetdb5/modules/kernel/algebra.mal b/monetdb5/modules/kernel/algebra.mal --- a/monetdb5/modules/kernel/algebra.mal +++ b/monetdb5/modules/kernel/algebra.mal @@ -84,30 +84,10 @@ address ALGuselect1 comment "Value select, but returning only the head values. SEE ALSO:select(bat,val)"; -command revert( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] -address ALGrevert -comment "Returns a BAT copy with buns in reverse order"; - command groupby(gids:bat[:oid,:oid], cnts:bat[:oid,:wrd]) :bat[:oid,:oid] address ALGgroupby comment "Produces a new BAT with groups identified by the head column. The result contains tail times the head value, ie the tail contains the result group sizes."; - -# Sorted copy _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list