Changeset: 5a686b788175 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a686b788175
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/ChangeLog
monetdb5/mal/Tests/dataflow01.mal
monetdb5/mal/Tests/dataflow01.stable.out
monetdb5/mal/Tests/tst033.mal
monetdb5/mal/Tests/tst033.stable.out
monetdb5/mal/Tests/tst034.mal
monetdb5/mal/Tests/tst034.stable.out
monetdb5/mal/Tests/tst220.mal
monetdb5/mal/Tests/tst220.stable.out
monetdb5/mal/Tests/tst275.stable.out
monetdb5/mal/Tests/tst903.mal
monetdb5/mal/Tests/tst903.stable.out
monetdb5/mal/Tests/tst911.mal
monetdb5/mal/Tests/tst911.stable.out
monetdb5/mal/Tests/tst912.mal
monetdb5/mal/Tests/tst912.stable.out
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/algebra.mal
monetdb5/modules/mal/Tests/mapi01.mal
monetdb5/modules/mal/Tests/mapi01.stable.out
monetdb5/modules/mal/Tests/mapi07.mal
monetdb5/modules/mal/Tests/mapi07.stable.out
monetdb5/optimizer/Tests/CXexample.mal
monetdb5/optimizer/Tests/CXexample.stable.out
monetdb5/optimizer/Tests/FTexample.mal
monetdb5/optimizer/Tests/FTexample.stable.out
monetdb5/optimizer/Tests/dataflow.mal
monetdb5/optimizer/Tests/dataflow.stable.out
monetdb5/optimizer/Tests/reorder00.mal
monetdb5/optimizer/Tests/reorder00.stable.out
monetdb5/optimizer/Tests/tst4000.mal
monetdb5/optimizer/Tests/tst4000.stable.out
monetdb5/optimizer/Tests/tst4003.mal
monetdb5/optimizer/Tests/tst4003.stable.out
monetdb5/optimizer/Tests/tst4030.mal
monetdb5/optimizer/Tests/tst4030.stable.out
monetdb5/optimizer/Tests/tst4700.mal
monetdb5/optimizer/Tests/tst4700.stable.out
monetdb5/tests/gdkTests/Tests/scanselect.mal
monetdb5/tests/gdkTests/Tests/scanselect.stable.out
Branch: default
Log Message:
Removed algebra.select and fixed tests to use algebra.subselect instead.
diffs (truncated from 1657 to 300 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -2495,18 +2495,6 @@ command algebra.selectNotNil(b:bat[:oid,
address ALGselectNotNil;
comment Select all not-nil values
-command algebra.select(b:bat[:oid,:any_2],value:any_2):bat[:oid,:any_2]
-address ALGselect1;
-comment Select all BUNs of a BAT with a certain tail value. Selection
on NIL is also possible (it should be properly casted, e.g.:int(nil)).
-
-command
algebra.select(b:bat[:oid,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:oid,:any_2]
-address ALGselectInclusive;
-comment Select all BUNs that have tail values: {v| low <{=} v <{=} high}.
Boundary inclusion is indicated separately. NIL boundary values have a
special meaning. + low == nil means: no lower bound + high == nil
means: no upper bound.
-
-command
algebra.select(b:bat[:oid,:any_2],low:any_2,high:any_2):bat[:oid,:any_2]
-address ALGselect;
-comment Select all BUNs that have tail values: {v| low <= v <= high}. NIL
boundary values have a special meaning. + low == nil means: no
lower bound + high == nil means: no upper bound. NOTE 1:
you should cast the nil to the appropriate type,
e.g. int(nil) in order to circumvent type clashes. NOTE 2: as the
'nil' element has no clear place in the ordered domain
of values, tuples with 'nil' values are NEVER
returned by the range select.
-
command
algebra.subselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],low:any_1,high:any_1,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
address ALGsubselect2;
comment Select all head values of the first input BAT for which the tail value
is in range and for which the head value occurs in the tail of the second
input BAT. The first input is a dense-headed BAT, the second input is a
dense-headed BAT with sorted tail, output is a dense-headed BAT with in the
tail the head value of the input BAT for which the tail value is between the
values low and high (inclusive if li respectively hi is set). The output BAT
is sorted on the tail value. If low or high is nil, the boundary is not
considered (effectively - and + infinity). If anti is set, the result is the
complement. Nil values in the tail are never matched, unless low=nil,
high=nil, li=1, hi=1, anti=0. All non-nil values are returned if low=nil,
high=nil, and li, hi are not both 1, or anti=1. Note that the output is
suitable as second input for this function.
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -3006,18 +3006,6 @@ command algebra.selectNotNil(b:bat[:oid,
address ALGselectNotNil;
comment Select all not-nil values
-command algebra.select(b:bat[:oid,:any_2],value:any_2):bat[:oid,:any_2]
-address ALGselect1;
-comment Select all BUNs of a BAT with a certain tail value. Selection
on NIL is also possible (it should be properly casted, e.g.:int(nil)).
-
-command
algebra.select(b:bat[:oid,:any_2],low:any_2,high:any_2,li:bit,hi:bit):bat[:oid,:any_2]
-address ALGselectInclusive;
-comment Select all BUNs that have tail values: {v| low <{=} v <{=} high}.
Boundary inclusion is indicated separately. NIL boundary values have a
special meaning. + low == nil means: no lower bound + high == nil
means: no upper bound.
-
-command
algebra.select(b:bat[:oid,:any_2],low:any_2,high:any_2):bat[:oid,:any_2]
-address ALGselect;
-comment Select all BUNs that have tail values: {v| low <= v <= high}. NIL
boundary values have a special meaning. + low == nil means: no
lower bound + high == nil means: no upper bound. NOTE 1:
you should cast the nil to the appropriate type,
e.g. int(nil) in order to circumvent type clashes. NOTE 2: as the
'nil' element has no clear place in the ordered domain
of values, tuples with 'nil' values are NEVER
returned by the range select.
-
command
algebra.subselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],low:any_1,high:any_1,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
address ALGsubselect2;
comment Select all head values of the first input BAT for which the tail value
is in range and for which the head value occurs in the tail of the second
input BAT. The first input is a dense-headed BAT, the second input is a
dense-headed BAT with sorted tail, output is a dense-headed BAT with in the
tail the head value of the input BAT for which the tail value is between the
values low and high (inclusive if li respectively hi is set). The output BAT
is sorted on the tail value. If low or high is nil, the boundary is not
considered (effectively - and + infinity). If anti is set, the result is the
complement. Nil values in the tail are never matched, unless low=nil,
high=nil, li=1, hi=1, anti=0. All non-nil values are returned if low=nil,
high=nil, and li, hi are not both 1, or anti=1. Note that the output is
suitable as second input for this function.
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -731,9 +731,6 @@ str ALGprojecttail(Client cntxt, MalBlkP
str ALGrangejoin2(bat *l, bat *r, const bat *lid, const bat *rlid, const bat
*rhid, const bit *li, const bit *hi);
str ALGreuse(bat *ret, const bat *bid);
str ALGsample(bat *result, const bat *bid, const int *param);
-str ALGselect(bat *result, const bat *bid, ptr low, ptr high);
-str ALGselect1(bat *result, const bat *bid, ptr value);
-str ALGselectInclusive(bat *result, const bat *bid, ptr low, ptr high, const
bit *lin, const bit *rin);
str ALGselectNotNil(bat *result, const bat *bid);
str ALGsemijoin(bat *result, const bat *lid, const bat *rid);
str ALGslice(bat *ret, const bat *bid, const lng *start, const lng *end);
diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog
--- a/monetdb5/ChangeLog
+++ b/monetdb5/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog file for MonetDB5
# This file is updated with Maddlog
+* Fri Sep 11 2015 Sjoerd Mullender <[email protected]>
+- Removed algebra.select. Use algebra.subselect instead.
+
* Wed Sep 9 2015 Sjoerd Mullender <[email protected]>
- Removed algebra.revert.
diff --git a/monetdb5/mal/Tests/dataflow01.mal
b/monetdb5/mal/Tests/dataflow01.mal
--- a/monetdb5/mal/Tests/dataflow01.mal
+++ b/monetdb5/mal/Tests/dataflow01.mal
@@ -26,7 +26,7 @@ end load;
function qry(z:bat[:oid,:lng],low:int,hgh:int):wrd;
l:= calc.lng(low);
h:= calc.lng(hgh);
- s:= algebra.select(z,l,h);
+ s:= algebra.subselect(z,l,h,true,true,false);
c:= aggr.count(s);
return qry:= c;
end qry;
diff --git a/monetdb5/mal/Tests/dataflow01.stable.out
b/monetdb5/mal/Tests/dataflow01.stable.out
--- a/monetdb5/mal/Tests/dataflow01.stable.out
+++ b/monetdb5/mal/Tests/dataflow01.stable.out
@@ -33,7 +33,7 @@ end user.load;
function user.qry(z:bat[:oid,:lng],low:int,hgh:int):wrd;
l := calc.lng(low);
h := calc.lng(hgh);
- s := algebra.select(z,l,h);
+ s := algebra.subselect(z,l,h,true,true,false);
c := aggr.count(s);
return qry := c;
end user.qry;
diff --git a/monetdb5/mal/Tests/tst033.mal b/monetdb5/mal/Tests/tst033.mal
--- a/monetdb5/mal/Tests/tst033.mal
+++ b/monetdb5/mal/Tests/tst033.mal
@@ -4,8 +4,11 @@ bat.append(b,1);
bat.append(b,2);
bat.append(b,3);
-z:= algebra.select(b,0,2); io.print(z);
-z:= algebra.select(b,0,2,true,true); io.print(z);
-z:= algebra.select(b,0,2,true,false); io.print(z);
-z:= algebra.select(b,0,2,false,true); io.print(z);
-z:= algebra.select(b,0,2,false,false); io.print(z);
+s := algebra.subselect(b,0,2,true,true,false); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,true,false,false); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,false,true,false); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,false,false,false); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,true,true,true); z := algebra.leftfetchjoin(s,b);
io.print(z);
+s := algebra.subselect(b,0,2,true,false,true); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,false,true,true); z :=
algebra.leftfetchjoin(s,b); io.print(z);
+s := algebra.subselect(b,0,2,false,false,true); z :=
algebra.leftfetchjoin(s,b); io.print(z);
diff --git a/monetdb5/mal/Tests/tst033.stable.out
b/monetdb5/mal/Tests/tst033.stable.out
--- a/monetdb5/mal/Tests/tst033.stable.out
+++ b/monetdb5/mal/Tests/tst033.stable.out
@@ -29,15 +29,29 @@ function user.main():void;
bat.append(b,1);
bat.append(b,2);
bat.append(b,3);
- z := algebra.select(b,0,2);
+ s := algebra.subselect(b,0,2,true,true,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
- z := algebra.select(b,0,2,true,true);
+ s := algebra.subselect(b,0,2,true,false,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
- z := algebra.select(b,0,2,true,false);
+ s := algebra.subselect(b,0,2,false,true,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
- z := algebra.select(b,0,2,false,true);
+ s := algebra.subselect(b,0,2,false,false,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
- z := algebra.select(b,0,2,false,false);
+ s := algebra.subselect(b,0,2,true,true,true);
+ z := algebra.leftfetchjoin(s,b);
+ io.print(z);
+ s := algebra.subselect(b,0,2,true,false,true);
+ z := algebra.leftfetchjoin(s,b);
+ io.print(z);
+ s := algebra.subselect(b,0,2,false,true,true);
+ z := algebra.leftfetchjoin(s,b);
+ io.print(z);
+ s := algebra.subselect(b,0,2,false,false,true);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
end user.main;
#--------------------------#
@@ -53,24 +67,41 @@ end user.main;
#-----------------#
[ 0@0, 0 ]
[ 1@0, 1 ]
-[ 2@0, 2 ]
-#-----------------#
+#--------------------------#
# h t # name
-# int int # type
-#-----------------#
-[ 0@0, 0 ]
-[ 1@0, 1 ]
+# void int # type
+#--------------------------#
+[ 0@0, 1 ]
+[ 1@0, 2 ]
#--------------------------#
# t t # name
# void int # type
#--------------------------#
-[ 1@0, 1 ]
-[ 2@0, 2 ]
+[ 0@0, 1 ]
#--------------------------#
# t t # name
# void int # type
#--------------------------#
-[ 1@0, 1 ]
+[ 0@0, 3 ]
+#--------------------------#
+# h t # name
+# void int # type
+#--------------------------#
+[ 0@0, 2 ]
+[ 1@0, 3 ]
+#--------------------------#
+# h t # name
+# void int # type
+#--------------------------#
+[ 0@0, 0 ]
+[ 1@0, 3 ]
+#--------------------------#
+# h t # name
+# void int # type
+#--------------------------#
+[ 0@0, 0 ]
+[ 1@0, 2 ]
+[ 2@0, 3 ]
# 07:58:41 >
# 07:58:41 > Done.
diff --git a/monetdb5/mal/Tests/tst034.mal b/monetdb5/mal/Tests/tst034.mal
--- a/monetdb5/mal/Tests/tst034.mal
+++ b/monetdb5/mal/Tests/tst034.mal
@@ -7,13 +7,13 @@ bat.append(b,3);
i:= bbp.getLRefCount(b);
io.printf("start of selections %d [1]\n",i);
-z:= algebra.select(b,0,2); io.print(z);
+s:= algebra.subselect(b,0,2,true,true,false); z:=algebra.leftfetchjoin(s,b);
io.print(z);
i:= bbp.getLRefCount(z);
io.printf("z select %d [1]\n",i);
i:= bbp.getLRefCount(b);
io.printf("select %d [1]\n",i);
-z:= algebra.select(b,0,2,true,false); io.print(z);
+s:= algebra.subselect(b,0,2,true,false,false); z:=algebra.leftfetchjoin(s,b);
io.print(z);
i:= bbp.getLRefCount(b);
io.printf("select %d [1]\n",i);
-z:= algebra.select(b,0,2,false,true); io.print(z);
-z:= algebra.select(b,0,2,false,false); io.print(z);
+s:= algebra.subselect(b,0,2,false,true,false); z:=algebra.leftfetchjoin(s,b);
io.print(z);
+s:= algebra.subselect(b,0,2,false,false,false); z:=algebra.leftfetchjoin(s,b);
io.print(z);
diff --git a/monetdb5/mal/Tests/tst034.stable.out
b/monetdb5/mal/Tests/tst034.stable.out
--- a/monetdb5/mal/Tests/tst034.stable.out
+++ b/monetdb5/mal/Tests/tst034.stable.out
@@ -41,19 +41,23 @@ function user.main():void;
bat.append(b,3);
i := bbp.getLRefCount(b);
io.printf("start of selections %d [1]\n",i);
- z := algebra.select(b,0,2);
+ s := algebra.subselect(b,0,2,true,true,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
i := bbp.getLRefCount(z);
io.printf("z select %d [1]\n",i);
i := bbp.getLRefCount(b);
io.printf("select %d [1]\n",i);
- z := algebra.select(b,0,2,true,false);
+ s := algebra.subselect(b,0,2,true,false,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
i := bbp.getLRefCount(b);
io.printf("select %d [1]\n",i);
- z := algebra.select(b,0,2,false,true);
+ s := algebra.subselect(b,0,2,false,true,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
- z := algebra.select(b,0,2,false,false);
+ s := algebra.subselect(b,0,2,false,false,false);
+ z := algebra.leftfetchjoin(s,b);
io.print(z);
end user.main;
start of selections 5 [1]
@@ -77,13 +81,13 @@ select 5 [1]
# t t # name
# void int # type
#--------------------------#
-[ 1@0, 1 ]
-[ 2@0, 2 ]
+[ 0@0, 1 ]
+[ 1@0, 2 ]
#--------------------------#
# t t # name
# void int # type
#--------------------------#
-[ 1@0, 1 ]
+[ 0@0, 1 ]
# 22:30:08 >
# 22:30:08 > Done.
diff --git a/monetdb5/mal/Tests/tst220.mal b/monetdb5/mal/Tests/tst220.mal
--- a/monetdb5/mal/Tests/tst220.mal
+++ b/monetdb5/mal/Tests/tst220.mal
@@ -43,8 +43,9 @@ end createone;
io.printf("assignment refcount =%d[1]\n",i);
#re-use a bat variable
- b4:= algebra.select(b,"bat C","bat C");
- io.print(b4);
+ b4:= algebra.subselect(b,"bat C","bat C",true,true,false);
+ b5:=algebra.leftfetchjoin(b4,b);
+ io.print(b5);
i:= bbp.getLRefCount(b);
io.printf("after 4rd assignment refcount =%d[2]\n",i);
diff --git a/monetdb5/mal/Tests/tst220.stable.out
b/monetdb5/mal/Tests/tst220.stable.out
--- a/monetdb5/mal/Tests/tst220.stable.out
+++ b/monetdb5/mal/Tests/tst220.stable.out
@@ -61,8 +61,9 @@ function user.main():void;
i := bbp.getLRefCount(b3);
io.printf("assignment refcount =%d[1]\n",i);
#re-use a bat variable
- b4 := algebra.select(b,"bat C","bat C");
- io.print(b4);
+ b4 := algebra.subselect(b,"bat C","bat C",true,true,false);
+ b5 := algebra.leftfetchjoin(b4,b);
+ io.print(b5);
i := bbp.getLRefCount(b);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list