Changeset: 157a1266ea17 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=157a1266ea17
Modified Files:
monetdb5/modules/kernel/alarm.mx
monetdb5/modules/kernel/algebra.mx
monetdb5/modules/kernel/array.mx
monetdb5/modules/kernel/calc.mx
monetdb5/modules/kernel/colcalc.mx
monetdb5/modules/kernel/colcast.mx
monetdb5/modules/kernel/colcolor.mx
monetdb5/modules/kernel/colifthen.mx
monetdb5/modules/kernel/colmmath.mx
monetdb5/modules/kernel/colmtime.mx
monetdb5/modules/kernel/colstr.mx
monetdb5/modules/kernel/column.mx
monetdb5/modules/kernel/group.mx
monetdb5/modules/kernel/microbenchmark.mx
monetdb5/modules/kernel/status.mx
monetdb5/modules/mal/bpm.mx
monetdb5/modules/mal/radix.mx
sql/backends/monet5/sql_scenario.mx
sql/backends/monet5/sql_user.mx
Branch: headless
Log Message:
Extended sweep
The sweep over the MAL signature were straightforward.
There is no guarantee that they remain as is.
Some code has already be removed
diffs (truncated from 7759 to 300 lines):
diff --git a/monetdb5/modules/kernel/alarm.mx b/monetdb5/modules/kernel/alarm.mx
--- a/monetdb5/modules/kernel/alarm.mx
+++ b/monetdb5/modules/kernel/alarm.mx
@@ -102,7 +102,7 @@
alarm_export str ALARMusec(lng *ret);
alarm_export str ALARMsleep(int *res, int *secs);
alarm_export str ALARMsetalarm(int *res, int *secs, str *action);
-alarm_export str ALARMtimers(int *res);
+alarm_export str ALARMtimers(int *res, int *res2);
alarm_export str ALARMctime(str *res);
alarm_export str ALARMepoch(int *res);
alarm_export str ALARMtime(int *res);
diff --git a/monetdb5/modules/kernel/algebra.mx
b/monetdb5/modules/kernel/algebra.mx
--- a/monetdb5/modules/kernel/algebra.mx
+++ b/monetdb5/modules/kernel/algebra.mx
@@ -53,9 +53,9 @@
address ALGexist
comment "Returns whether 'v' occurs as a value in column b.";
-command position(b:col[:any_1], v:any_1):wrd
+command position(b:col[:any_1], v:any_1):oid
address ALGposition
-comment "Returns column index position [0.. b.count] of 'v'.
+comment "Returns column position [0.. b.count] of 'v'.
It Return an error if 'v' does not exist.";
command fetch(b:col[:any_1], x:oid) :any_1
@@ -68,17 +68,17 @@
command selectNotNil(b:col[:any_1]):col[:oid]
address ALGselectNotNil
-comment "Select all not-nil values";
+comment "Select all not-nil value references";
command slice(b:col[:any_1], x:oid, y:oid) :col[:any_1]
address ALGslice
comment "Return the slice with the values at position x till y.";
-command topN( b:col[:any_1], top:lng ) :col[:any_1]
+command topN( b:col[:any_1], top:oid ) :col[:any_1]
address ALGtopN
-comment "Trim all but the top N tuples.";
-
-command uselect(b:col[:any_1], low:any_1, high:any_1, li:bit, hi:bit)
:col[:oid]
+comment "Trim all but the top N values.";
+
+command select(b:col[:any_1], low:any_1, high:any_1, li:bit, hi:bit)
:col[:oid]
address ALGuselectInclusive
comment "Select all positions that have values: {v| low <= v <= high}.
NIL boundary values have a special meaning.
@@ -90,106 +90,82 @@
ordered domain of values, tuples with 'nil'
values
are NEVER returned by the range select.";
-command thetauselect(b:col[:any_1], val:any_1, op:str) :col[:oid]
+command thetaselect(b:col[:any_1], val:any_1, op:str) :col[:oid]
address ALGthetauselect
-comment "The theta (<=,<,=,>,>=) select() ";
-
-command antiuselect(b:col[:any_1], value:any_1) :col[:oid]
+comment "The theta (<=,<,=,>,>=) version select() ";
+
+command antiselect(b:col[:any_1], val:any_1) :col[:oid]
address ALGantiuselect1
-comment "Value select, but returning only those not valid ";
-
-@- Pattern matching
-@mal
+comment "The complement of a single value selection";
+
command like(b:col[:str], substr:str) :col[:oid]
address ALGlike
-comment "Selects all elements that have 'substr' as in the tail.";
-
-@- Sampling
-@mal
+comment "Selects all positions that have 'substr' as in the tail.";
+
command sample ( b:col[:any_1], num:int ) :col[:oid]
address ALGsample
comment "Produce a random selection of size 'num' from the input BAT.";
-@+ BAT copying
-@mal
+
command copy( b:col[:any_1]) :col[:any_1]
address ALGcopy
-comment "Returns physical copy of a BAT.";
-@- Sorted copy
-@mal
-command sort( b:col[:any_1]) :col[:any_1]
+comment "Returns physical copy of a column.";
+
+
+command sort( b:col[:any_1]) :col[:oid]
address ALGsort
comment "Returns a column copy sorted on the value.";
-command sortReverse( b:col[:any_1]) :col[:any_1]
+command sortReverse( b:col[:any_1]) :col[:oid]
address ALGsort_rev
comment "Returns a column copy reversely sorted on the value.";
-command ssort( b:col[:any_1]) :col[:any_1]
+command ssort( b:col[:any_1]) :col[:oid]
address ALGssort
comment "Returns copy of a column with the values sorted on ascending values.
This is a stable sort.";
-command ssort_rev( b:col[:any_1]) :col[:any_1]
+command ssort_rev( b:col[:any_1]) :col[:oid]
address ALGssort_rev
comment "Returns copy of a column with the values sorted on descending values.
This is a stable sort.";
+command order(b:col[:any_1]) :col[:any_1]
+address ALGorder
+comment "Sorts the BAT itself in place. ";
+command orderReverse(b:col[:any_1]) :col[:any_1]
+address ALGorder_rev
+comment "Reverse sorts the BAT itself on the head, in place. ";
+
command revert( b:col[:any_1]) :col[:any_1]
address ALGrevert
-comment "Returns a BAT copy with buns in reverse order";
-
-@+ Set operations
-
-@noindent Operands provided are:
-@itemize
-@item unique("col[:any_1]) :col[:any_1]
-produces a copy of the bat, with double elimination
-@item union(:col[:any_1],col[:any_1]) :col[:any_1]
-bat union.
-@item difference(:col[:any_1],:col[:any_1]) :col[:any_1]
-bat difference.
-@item intersection(:col[:any_1],:col[:any_1]) :col[:any_1]
-bat intersection.
-@end itemize
-Implementations typically take two forms: if the input relation(s) is/are
-ordered, a merge-algorithm is used. Otherwise, hash-indices are produced
-on demand for the hash-based algorithms.
-
-@mal
+comment "Returns a BAT copy with elements in reverse order";
+
command unique (b:col[:any_1] ) :col[:any_1]
address ALGunique
comment "Select unique vaules from the input column.
- Result is a column with real set() semantics.";
-
-@- Bun-intersecting elements
-@mal
+ Result is a column with real set value semantics.";
+
+
command intersect ( left:col[:any_1], right:col[:any_1]) :col[:oid]
address ALGsintersect
-comment "Returns the intersection taken over *both* columns of two BATs.
+comment "Returns the intersection taken over *both* columns of two columns.
Results in all BUNs of 'left' that are also in 'right'. Does
*not*
- do double-elimination over the 'left' BUNs, If you want this,
use:
- 'sintersect(sunique(left),sunique(right))'
- or: 'sunique(sintersect(left,right))'.";
-
-@- Head-intersecting elements (a.k.a. semijoin)
-@mal
+ do double-elimination over the 'left' column, If you want this,
use:
+ 'intersect(unique(left),unique(right))' ";
+
command semijoin( left:col[:any_1], right:col[:any_1] ) :col[:oid]
address ALGsemijoin
comment "Returns the intersection taken over the column values.
Does *not* do double-elimination over the 'left' .
- If you want this, use:
'kintersect(kunique(left),kunique(right))'
- or: 'kunique(kintersect(left,right))'.";
-
-@- Set operations
-@mal
+ If you want this, use: 'intersect(unique(left),unique(right))'
";
+
command difference( left:col[:any_1], right:col[:any_1] ) :col[:any_1]
-address ALGsdiff
+address ALGdiff
comment "Returns the difference taken over *both* columns.
Does *not* do double-elimination over the 'left' BUNs.
If you want this, use:
- 'sdifference(left.sunique,right.sunique)'
- or: 'sdifference(left,right).sunique'.";
+ 'sdifference(left.sunique,right.sunique)' ";
command union ( left:col[:any_1], right:col[:any_1]) :col[:any_1]
-address ALGsunion
+address ALGunion
comment "Returns the union of two columns;
Results in all values of 'left' that are not in 'right', plus
all
values of 'right'. *no* double-elimination is done.
@@ -197,12 +173,7 @@
'sunion(left.sunique,right.sunique)'
or: 'sunion(left,right).sunique'.";
-@+ Join operations
-The core of every relational engine.
-The join collection provided by the GDK kernel.
-Note that joins over void columns are handled as if they are oids.
-@mal
-command crossproduct(left:col[:any_1], right:col[:any_3])
(lo:col[:oid],ro:col[:oid])
+command crossproduct(left:col[:any_1], right:col[:any_2])
(lo:col[:oid],ro:col[:oid])
address ALGcross
comment "Returns the cross product";
@@ -260,16 +231,16 @@
command thetajoin ( left:col[:any_1], right:col[:any_1], opname:int,
estimate:lng ) (lo:col[:any_1] , ro:col[:any_1])
address ALGthetajoinEstimate;
-@- Band Join (approximate match)
-@mal
-command bandjoin ( left:col[:any_1], right:col[:any_1], minus:any_2,
plust:any_2 ) (lo:col[:any_1] , ro:col[:any_1])
+
+
+command bandjoin ( left:col[:any_1], right:col[:any_1], minus:any_1,
plust:any_1 ) (lo:col[:oid] , ro:col[:oid])
address ALGbandjoin_default
comment "This is a join() for which the predicate is that two columns match
- if the value is within the range [right-head - minus,
- right-head + plus]. Works only for the builtin numerical types,
+ if the value is within the range [right - minus,
+ right + plus]. Works only for the builtin numerical types,
and their derivates.";
-command bandjoin ( left:col[:any_1], right:col[:any_1], minus:any_2,
plust:any_2, li:bit, hi:bit ) (lo:col[:any_1] , ro:col[:any_1])
+command bandjoin ( left:col[:any_1], right:col[:any_1], minus:any_1,
plust:any_1, li:bit, hi:bit ) (lo:col[:any_1] , ro:col[:any_1])
address ALGbandjoin
comment "This is a join() for which the predicate is that two BUNs match
if the left-tail value is within the range [right-head - minus,
@@ -278,16 +249,14 @@
and their derivates.";
-@+ Projection operations
-@mal
command project(b:col[:any_1],v:col[:oid]) :col[:any_1]
address ALGprojectNIL
-comment "Extract the head of a BAT.";
+comment "Extract the values from a column.";
@= projectGrp
-command project(v:@1,b:col[:any_1]) :col[:@1]
+command project(b:col[:any_1],v:@1) :col[:@1]
address ALGprojecttail@1
-comment "Fill the column with a constant, e.g. [0~b]";
+comment "Fill the column with a constant";
@mal
@:projectGrp(bit)@
@:projectGrp(chr)@
@@ -299,7 +268,7 @@
@:projectGrp(flt)@
@:projectGrp(dbl)@
-command mark_grp( b:col[:any_1,:oid], g:col[:oid,:oid]) :col[:any_1,:oid]
+command mark_grp( b:col[:any_1], g:col[:oid]) :col[:oid]
address ALGmark_grp_1
comment "\"grouped mark\": Produces a new BAT with per group a locally unique
dense
ascending sequence of OIDs in the tail. The tail of the first BAT (b)
@@ -308,7 +277,7 @@
from b's tail. The tail of g gives for each group the base value for the new
OID sequence.";
-command mark_grp(b:col[:any_1,:oid], g:col[:oid,:any_2], s:oid)
:col[:any_1,:oid]
+command mark_grp(b:col[:any_1], g:col[:oid], s:oid) :col[:oid]
address ALGmark_grp_2
comment "\"grouped mark\": Produces a new BAT with per group a locally unique
dense
ascending sequense of OIDs in the tail. The tail of the first BAT (b)
@@ -321,11 +290,6 @@
address ALGmaterialize
comment "Materialize the column index";
-@+ Common BAT Aggregates
-These operations examine a BAT, and compute some simple aggregate result
-over it.
-@- BAT size
-@mal
module aggr;
command count( b:col[:any_1] ) :wrd
@@ -340,8 +304,6 @@
comment "Return the number of elements currently
in a column ignoring values with nil-tail";
-@- Histogram on Tail
-@mal
command histogram ( b:col[:any_1]) (lo:col[:oid],rv:col[:wrd]);
address ALGhistogram
comment "Produce a column group containing the histogram over the values.";
@@ -692,7 +654,7 @@
algebra_export str ALGminany(ptr result, int *bid);
algebra_export str ALGmaxany(ptr result, int *bid);
-algebra_export str ALGtopN(int *res, int *bid, lng *top);
+algebra_export str ALGtopN(int *res, int *bid, oid *top);
algebra_export str ALGgroupby(int *res, int *bid);
algebra_export str ALGcard(lng *result, int *bid);
algebra_export str ALGBATminimum(ptr *result, int *bid);
@@ -741,8 +703,7 @@
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list