Changeset: 5f359a13cfa2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5f359a13cfa2
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_none.stable.out
clients/Tests/exports.stable.out
gdk/gdk_batop.c
monetdb5/ChangeLog.Oct2014
monetdb5/mal/Tests/All
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/algebra.h
monetdb5/modules/kernel/algebra.mal
Branch: Oct2014
Log Message:
Removed BATtopN and algebra.topN.
diffs (190 lines):
diff --git a/clients/Tests/MAL-signatures_all.stable.out
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -2787,10 +2787,6 @@ command algebra.thetauselect(b:bat[:any_
address ALGthetauselect;
comment The theta (<=,<,=,>,>=) select() limited to head values
-command algebra.topN(b:bat[:any_1,:any_2],top:lng):bat[:any_1,:any_2]
-address ALGtopN;
-comment Trim all but the top N tuples.
-
command
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
address ALGthetasubselect2;
comment Select all head values of the first input BAT for which the tail value
obeys the relation value OP VAL and for which the head value occurs in the
tail of the second input BAT. Input is a dense-headed BAT, output is a
dense-headed BAT with in the tail the head value of the input BAT for
which the relationship holds. The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -2788,10 +2788,6 @@ command algebra.thetauselect(b:bat[:any_
address ALGthetauselect;
comment The theta (<=,<,=,>,>=) select() limited to head values
-command algebra.topN(b:bat[:any_1,:any_2],top:lng):bat[:any_1,:any_2]
-address ALGtopN;
-comment Trim all but the top N tuples.
-
command
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
address ALGthetasubselect2;
comment Select all head values of the first input BAT for which the tail value
obeys the relation value OP VAL and for which the head value occurs in the
tail of the second input BAT. Input is a dense-headed BAT, output is a
dense-headed BAT with in the tail the head value of the input BAT for
which the relationship holds. The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_geom.stable.out
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -2788,10 +2788,6 @@ command algebra.thetauselect(b:bat[:any_
address ALGthetauselect;
comment The theta (<=,<,=,>,>=) select() limited to head values
-command algebra.topN(b:bat[:any_1,:any_2],top:lng):bat[:any_1,:any_2]
-address ALGtopN;
-comment Trim all but the top N tuples.
-
command
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
address ALGthetasubselect2;
comment Select all head values of the first input BAT for which the tail value
obeys the relation value OP VAL and for which the head value occurs in the
tail of the second input BAT. Input is a dense-headed BAT, output is a
dense-headed BAT with in the tail the head value of the input BAT for
which the relationship holds. The output BAT is sorted on the tail value.
diff --git a/clients/Tests/MAL-signatures_none.stable.out
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -2787,10 +2787,6 @@ command algebra.thetauselect(b:bat[:any_
address ALGthetauselect;
comment The theta (<=,<,=,>,>=) select() limited to head values
-command algebra.topN(b:bat[:any_1,:any_2],top:lng):bat[:any_1,:any_2]
-address ALGtopN;
-comment Trim all but the top N tuples.
-
command
algebra.thetasubselect(b:bat[:oid,:any_1],s:bat[:oid,:oid],val:any_1,op:str):bat[:oid,:oid]
address ALGthetasubselect2;
comment Select all head values of the first input BAT for which the tail value
obeys the relation value OP VAL and for which the head value occurs in the
tail of the second input BAT. Input is a dense-headed BAT, output is a
dense-headed BAT with in the tail the head value of the input BAT for
which the relationship holds. The output BAT is sorted on the tail value.
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
@@ -205,7 +205,6 @@ BAT *BATsubunique(BAT *b, BAT *s);
gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, int skip_nils, int
abort_on_error, int nil_if_empty);
BAT *BATthetajoin(BAT *l, BAT *r, int mode, BUN estimate);
BAT *BATthetasubselect(BAT *b, BAT *s, const void *val, const char *op);
-int BATtopN(BAT *b, BUN topN);
BAT *BATundo(BAT *b);
BAT *BATuselect(BAT *b, const void *tl, const void *th);
BAT *BATuselect_(BAT *b, const void *tl, const void *th, bit li, bit hi);
@@ -825,7 +824,6 @@ str ALGtintersect(int *result, int *lid,
str ALGtmark(int *result, int *bid, oid *base);
str ALGtmark_default(int *result, int *bid);
str ALGtmarkp(int *result, int *bid, int *nr_parts, int *part_nr);
-str ALGtopN(int *res, int *bid, lng *top);
str ALGtsort(int *result, int *bid);
str ALGtsort_rev(int *result, int *bid);
str ALGtunion(int *result, int *lid, int *rid);
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -908,36 +908,6 @@ BATslice(BAT *b, BUN l, BUN h)
}
/*
- * Top-N selection
- *
- * The top-N elements can be easily obtained by trimming the
- * space. The auxiliary index structures are removed. For
- * non-variable size BATs it merely requires adjustment of the free
- * space labels. Other BATs require a loop through the tuples to be
- * deleted. [todo]
- */
-int
-BATtopN(BAT *b, BUN topN)
-{
- BATcheck(b, "BATtopN");
- if (topN > BATcount(b)) {
- GDKerror("BATtopN: not enough tuples in target\n");
- } else if (b->H->varsized || b->T->varsized) {
- HASHremove(b);
- while (BATcount(b) > topN)
- BUNdelete(b, BUNlast(b), FALSE);
- } else {
- HASHremove(b);
- BATsetcount(b, topN);
- }
- IMPSdestroy(b);
- /* we no longer know if there are NILs */
- b->H->nil = b->htype == TYPE_void && b->hseqbase == oid_nil && topN >=
1;
- b->T->nil = b->ttype == TYPE_void && b->tseqbase == oid_nil && topN >=
1;
- return 0;
-}
-
-/*
* BAT Sorting
* BATsort returns a sorted copy. BATorder sorts the BAT itself.
*/
diff --git a/monetdb5/ChangeLog.Oct2014 b/monetdb5/ChangeLog.Oct2014
--- a/monetdb5/ChangeLog.Oct2014
+++ b/monetdb5/ChangeLog.Oct2014
@@ -2,6 +2,8 @@
# This file is updated with Maddlog
* Mon Aug 25 2014 Sjoerd Mullender <[email protected]>
+- Removed algebra.topN and its imlementation BATtopN. The function was
+ not used.
- Removed aggr.histogram and its implementation BAThistogram. The
function was not used, and did not produce output in the "headless"
(i.e. dense-headed) format. Histograms can be created as a by-product
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -131,7 +131,7 @@ tst253
tst255
tst2550
tst256
-tst260
+# tst260 -- algebra.topN removed
tst2570
# tst265 -- windowsum and slidingsum have been removed
# opens /tmp/MonetEvents, i.e. not on Windows:
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
@@ -319,22 +319,6 @@ ALGmaxany(ptr result, int *bid)
}
str
-ALGtopN(int *res, int *bid, lng *top)
-{
- BAT *b;
-
- b = BATdescriptor(*bid);
- if (b == NULL) {
- throw(MAL, "algebra.top", RUNTIME_OBJECT_MISSING);
- }
- /* TOP N works inplace, ie deletes ... */
- (void) BATtopN(b, (BUN) *top);
- *res = b->batCacheid;
- BBPkeepref(b->batCacheid);
- return MAL_SUCCEED;
-}
-
-str
ALGgroupby(int *res, int *gids, int *cnts)
{
BAT *bn, *g, *c;
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
@@ -43,7 +43,6 @@ algebra_export str ALGvariancep(dbl *res
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 ALGgroupby(int *res, int *gids, int *cnts);
algebra_export str ALGcard(lng *result, int *bid);
algebra_export str ALGsubselect1(bat *result, bat *bid, const void *low, const
void *high, const bit *li, const bit *hi, const bit *anti);
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
@@ -151,10 +151,6 @@ command subslice(b:bat[:oid,:any_1], x:w
address ALGsubslice_wrd
comment "Return the oids of the slice with the BUNs at position x till y.";
-command topN( b:bat[:any_1,:any_2], top:lng ) :bat[:any_1,:any_2]
-address ALGtopN
-comment "Trim all but the top N tuples.";
-
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.";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list