Changeset: 3b231378ed7b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b231378ed7b
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/exports.stable.out
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/algebra.mal
Branch: default
Log Message:
Drop position() operation
diffs (222 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
@@ -2563,14 +2563,6 @@ command algebra.project(b:bat[:any_1,:an
address ALGprojectNIL;
comment Extract the head of a BAT.
-command algebra.position(b:bat[:any_1,:any_2],val:any_1,tval:any_2):wrd
-address ALGpositionBUN;
-comment Returns the position of the value pair It returns an error if 'val'
does not exist.
-
-command algebra.position(b:bat[:any_1,:any_2],v:any_1):wrd
-address ALGposition;
-comment Returns BAT position [0.. b.count] of 'v' in the head column of b. It
Return an error if 'v' does not exist.
-
command algebra.reuse(b:bat[:oid,:any_2]):bat[:oid,:any_2]
address ALGreuse;
comment Reuse a temporary BAT if you can. Otherwise, allocate enough storage
to accept result of an operation (not involving the heap)
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
@@ -779,8 +779,6 @@ str ALGmaxany(ptr result, int *bid);
str ALGminany(ptr result, int *bid);
str ALGouterjoin(int *result, int *lid, int *rid);
str ALGouterjoinestimate(int *result, int *lid, int *rid, lng *estimate);
-str ALGposition(wrd *retval, int *bid, ptr val);
-str ALGpositionBUN(wrd *retval, int *bid, ptr val, ptr tval);
str ALGprejoin(int *rl, int *rr, int *l, int *r);
str ALGprojectNIL(int *ret, int *bid);
str ALGprojecthead(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
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
@@ -18,9 +18,8 @@
*/
/*
- * @a Peter Boncz, Martin Kersten, Niels Nes, Sjoerd Mullender
- * @v 2.0
- * @+ BAT Algebra
+ * (c) Peter Boncz, Martin Kersten, Niels Nes, Sjoerd Mullender
+ * BAT Algebra
* This modules contains the most common algebraic BAT manipulation
* commands. We call them algebra, because all operations take
* values as parameters, and produce new result values, but
@@ -54,11 +53,11 @@
#include <math.h>
/*
- * @* Command Implementations in C
+ * Command Implementations in C
* This module contains just a wrapper implementations; since all described
* operations are part of the GDK kernel.
*
- * @+ BAT sum operation
+ * BAT sum operation
* The sum aggregate only works for int and float fields.
* The routines below assumes that the caller knows what type
* is large enough to prevent overflow.
@@ -161,7 +160,6 @@ CMDgen_group(BAT **result, BAT *gids, BA
/*
- * @- Substring Select
* The string pattern matching routine has been added. It should be
* dynamically linked.
* A simple string matcher is included. It should be refined later on
@@ -233,9 +231,6 @@ CMDlike(BAT **ret, BAT *b, str s)
return GDK_SUCCEED;
}
-/*
- * @- BAT slice
- */
static int
slice(BAT **retval, BAT *b, lng start, lng end)
{
@@ -253,40 +248,13 @@ slice(BAT **retval, BAT *b, lng start, l
return (*retval = BATslice(b, (BUN) start, (BUN) end + 1)) ?
GDK_SUCCEED : GDK_FAIL;
}
-
/*
- * @- BUN Get/Fetch
- */
-static int
-CMDposition(wrd *retval, BAT *b, ptr val)
-{
- BUN v = BUNfnd(b, val);
-
- if (v == BUN_NONE)
- return GDK_FAIL;
- *retval = (wrd) (v - BUNfirst(b));
- return GDK_SUCCEED;
-}
-
-static int
-CMDpositionBUN(wrd *retval, BAT *b, ptr val, ptr tval)
-{
- BUN v = BUNlocate(b, val, tval);
-
- if (v == BUN_NONE)
- return GDK_FAIL;
- *retval = (wrd) (v - BUNfirst(b));
- return GDK_SUCCEED;
-}
-
-
-/*
- * @- Wrapper
+ *
* The remainder of this file contains the wrapper around the V4 code base
* The BAT identifiers passed through this module may indicate
* that the 'reverse' view applies. This should be taken into
* account while resolving them.
- * @+ BAT sum and product aggregation
+ *
* The sum aggregate only works for int and float fields.
* The routines below assumes that the caller knows what type
* is large enough to prevent overflow.
@@ -2153,42 +2121,8 @@ ALGsubslice_wrd(int *ret, bat *bid, wrd
}
/*
- * @- BUN Get/Fetch
+ * BUN Get/Fetch
*/
-str
-ALGposition(wrd *retval, int *bid, ptr val)
-{
- BAT *b;
-
- if ((b = BATdescriptor(*bid)) == NULL) {
- throw(MAL, "algebra.position", RUNTIME_OBJECT_MISSING);
- }
- derefStr(b, h, val);
- if (CMDposition(retval, b, val) == GDK_FAIL){
- BBPreleaseref(b->batCacheid);
- throw(MAL, "algebra.position", GDK_EXCEPTION "Item not found");
- }
- BBPreleaseref(b->batCacheid);
- return MAL_SUCCEED;
-}
-
-str
-ALGpositionBUN(wrd *retval, int *bid, ptr val, ptr tval)
-{
- BAT *b;
-
- if ((b = BATdescriptor(*bid)) == NULL) {
- throw(MAL, "algebra.position", RUNTIME_OBJECT_MISSING);
- }
- derefStr(b, h, val);
- derefStr(b, t, tval);
- if( (CMDpositionBUN(retval, b, val, tval) == GDK_FAIL) ){
- BBPreleaseref(b->batCacheid);
- throw(MAL, "algebra.position", GDK_EXCEPTION "Item not found");
- }
- BBPreleaseref(b->batCacheid);
- return MAL_SUCCEED;
-}
static str
doALGfetch(ptr ret, BAT *b, BUN pos)
@@ -2456,7 +2390,6 @@ str ALGreuse(int *ret, int *bid)
}
/*
- * @+ BAT avg operation
* The avg aggregate only works for int and float fields.
*/
str
@@ -2479,7 +2412,7 @@ ALGavg(dbl *res, int *bid)
}
/*
- * @+ BAT standard deviation
+ * BAT standard deviation
*/
str
ALGstdev(dbl *res, int *bid)
@@ -2514,7 +2447,7 @@ ALGstdevp(dbl *res, int *bid)
}
/*
- * @+ BAT variance
+ * BAT variance
*/
str
ALGvariance(dbl *res, int *bid)
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
@@ -144,8 +144,6 @@ algebra_export str ALGslice_int(int *ret
algebra_export str ALGslice_wrd(int *ret, bat *bid, wrd *start, wrd *end);
algebra_export str ALGslice_oid(int *ret, bat *bid, oid *start, oid *end);
algebra_export str ALGsubslice_wrd(int *ret, bat *bid, wrd *start, wrd *end);
-algebra_export str ALGposition(wrd *retval, int *bid, ptr val);
-algebra_export str ALGpositionBUN(wrd *retval, int *bid, ptr val, ptr tval);
algebra_export str ALGfetch(ptr ret, int *bid, lng *pos);
algebra_export str ALGfetchoid(int *ret, int *bid, oid *pos);
algebra_export str ALGfetchint(int *ret, int *bid, int *pos);
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
@@ -30,16 +30,6 @@ address ALGfind
comment "Returns the tail value 't' for which some [h,t] BUN
exists in b. If no such BUN exists, an error occurs." ;
-command position(b:bat[:any_1,:any_2], v:any_1):wrd
-address ALGposition
-comment "Returns BAT position [0.. b.count] of 'v' in the head
- column of b. It Return an error if 'v' does not exist.";
-
-command position(b:bat[:any_1,:any_2], val:any_1, tval:any_2) :wrd
-address ALGpositionBUN
-comment "Returns the position of the value pair It returns an
- error if 'val' does not exist.";
-
command fetch(b:bat[:any_2,:any_1], x:oid) :any_1
address ALGfetchoid;
command fetch(b:bat[:any_2,:any_1], x:lng) :any_1
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list