Changeset: b7ecedef3249 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b7ecedef3249
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.h
        gdk/gdk_align.c
        gdk/gdk_batop.c
        gdk/gdk_private.h
        monetdb5/ChangeLog.Oct2014
        monetdb5/mal/Tests/All
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/algebra.h
        monetdb5/modules/kernel/algebra.mal
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 631 to 300 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
@@ -208,10 +208,6 @@ comment Return the current size (in numb
 
 command aggr.exist(b:bat[:oid,:any_2],h:any_1):bit 
 address ALGexist;
-command aggr.histogram(b:bat[:any_1,:any_2]):bat[:any_2,:int] 
-address ALGhistogram;
-comment Produce a BAT containing the histogram over the tail values.
-
 command aggr.jsonaggr(val:bat[:oid,:dbl]):str 
 address JSONgroupStr;
 comment Aggregate the double values to array.
@@ -2671,10 +2667,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
@@ -208,9 +208,6 @@ comment Return the current size (in numb
 
 command aggr.exist(b:bat[:oid,:any_2],h:any_1):bit 
 address ALGexist;
-command aggr.histogram(b:bat[:any_1,:any_2]):bat[:any_2,:int] 
-address ALGhistogram;
-comment Produce a BAT containing the histogram over the tail values.
 
 command aggr.jsonaggr(val:bat[:oid,:dbl]):str 
 address JSONgroupStr;
@@ -2671,10 +2668,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
@@ -208,9 +208,6 @@ comment Return the current size (in numb
 
 command aggr.exist(b:bat[:oid,:any_2],h:any_1):bit 
 address ALGexist;
-command aggr.histogram(b:bat[:any_1,:any_2]):bat[:any_2,:int] 
-address ALGhistogram;
-comment Produce a BAT containing the histogram over the tail values.
 
 command aggr.jsonaggr(val:bat[:oid,:dbl]):str 
 address JSONgroupStr;
@@ -2671,10 +2668,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
@@ -207,9 +207,6 @@ comment Return the current size (in numb
 
 command aggr.exist(b:bat[:oid,:any_2],h:any_1):bit 
 address ALGexist;
-command aggr.histogram(b:bat[:any_1,:any_2]):bat[:any_2,:int] 
-address ALGhistogram;
-comment Produce a BAT containing the histogram over the tail values.
 
 command aggr.jsonaggr(val:bat[:oid,:dbl]):str 
 address JSONgroupStr;
@@ -2670,10 +2667,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
@@ -136,7 +136,6 @@ BAT *BATgroupvariance_population(BAT *b,
 BAT *BATgroupvariance_sample(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int 
skip_nils, int abort_on_error);
 BUN BATgrows(BAT *b);
 BAT *BAThash(BAT *b, BUN masksize);
-BAT *BAThistogram(BAT *b);
 BAT *BATimprints(BAT *b);
 BAT *BATins(BAT *b, BAT *c, bit force);
 BAT *BATintersectcand(BAT *a, BAT *b);
@@ -206,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);
@@ -756,7 +754,6 @@ str ALGfetchoid(int *ret, int *bid, oid 
 str ALGfind(ptr ret, int *bid, ptr val);
 str ALGfirstn(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ALGgroupby(int *res, int *gids, int *cnts);
-str ALGhistogram(int *result, int *bid);
 str ALGhmarkp(int *result, int *bid, int *nr_parts, int *part_nr);
 str ALGhsort(int *result, int *bid);
 str ALGhsort_rev(int *result, int *bid);
@@ -838,7 +835,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);
@@ -2347,7 +2343,6 @@ int hasSameSignature(MalBlkPtr mb, Instr
 int hasSideEffects(InstrPtr p, int strict);
 str hashRef;
 int headProp;
-str histogramRef;
 int hlbProp;
 int horiginProp;
 int hubProp;
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3210,55 +3210,17 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
  * @+ Common BAT Operations
  * Much used, but not necessarily kernel-operations on BATs.
  *
- * @- BAT aggregates
- * @multitable @columnfractions 0.08 0.7
- * @item BAT*
- * @tab
- *  BAThistogram(BAT *b)
- * @item BAT*
- * @end multitable
- *
- * The routine BAThistogram produces a new BAT with a frequency
- * distribution of the tail of its operand.
- *
  * For each BAT we maintain its dimensions as separately accessible
  * properties. They can be used to improve query processing at higher
  * levels.
  */
 
-#define GDK_AGGR_SIZE 1
-#define GDK_AGGR_CARD 2
 #define GDK_MIN_VALUE 3
 #define GDK_MAX_VALUE 4
 
 gdk_export void PROPdestroy(PROPrec *p);
 gdk_export PROPrec *BATgetprop(BAT *b, int idx);
 gdk_export void BATsetprop(BAT *b, int idx, int type, void *v);
-gdk_export BAT *BAThistogram(BAT *b);
-gdk_export int BATtopN(BAT *b, BUN topN);      /* used in 
monet5/src/modules/kernel/algebra.mx */
-
-/*
- * @- Alignment transformations
- * Some classes of algebraic operators transform a sequence in an
- * input BAT always in the same way in the output result. An example
- * are the @{X@}() function (including histogram(b), which is
- * identical to @{count@}(b.reverse)).  That is to say, if
- * synced(b2,b2) => synced(@{X@}(b1),@{Y@}(b2))
- *
- * Another example is b.fetch(position-bat). If synced(b2,b2) and the
- * same position-bat is fetched with, the results will again be
- * synced.  This can be mimicked by transforming the
- * @emph{alignment-id} of the input BAT with a one-way function onto
- * the result.
- *
- * We use @strong{output->halign = NOID_AGGR(input->halign)} for the
- * @strong{output = @{X@}(input)} case, and @strong{output->align =
- * NOID_MULT(input1->align,input2->halign)} for the fetch.
- */
-#define AGGR_MAGIC     111
-#define NOID(x)                ((oid)(x))
-#define NOID_AGGR(x)   NOID_MULT(AGGR_MAGIC,x)
-#define NOID_MULT(x,y) NOID( (lng)(y)*(lng)(x) )
 
 /*
  * @- BAT relational operators
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -118,10 +118,6 @@ ALIGNsetH(BAT *b1, BAT *b2)
        if (b2->halign == 0) {
                b2->halign = OIDnew(1);
                b2->batDirtydesc = TRUE;
-       } else {
-               /* propagate GDK_AGGR information */
-               BATpropagate(b1, b2, GDK_AGGR_SIZE);
-               BATpropagate(b1, b2, GDK_AGGR_CARD);
        }
        if (BAThvoid(b2)) {
                /* b2 is either dense or has a void(nil) head */
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.
  */
@@ -1440,12 +1410,6 @@ BATmark(BAT *b, oid oid_base)
        return bn;
 }
 
-static void
-BATsetprop_wrd(BAT *b, int idx, wrd val)
-{
-       BATsetprop(b, idx, TYPE_wrd, &val);
-}
-
 #define mark_grp_init(BUNfnd)                          \
        do {                                            \
                BUN w;                                  \
@@ -1782,7 +1746,6 @@ BATconst(BAT *b, int tailtype, const voi
  * is a nil value present by mis-using the highest bits of both
  * GDK_AGGR_SIZE and GDK_AGGR_CARD.
  */
-#define GDK_NIL_BIT 0x80000000 /* (1 << 31) */
 
 void
 PROPdestroy(PROPrec *p)
@@ -1830,204 +1793,6 @@ BATsetprop(BAT *b, int idx, int type, vo
        }
 }
 
-void
-BATpropagate(BAT *dst, BAT *src, int idx)
-{
-       PROPrec *p = BATgetprop(src, idx);
-
-       if (p)
-               BATsetprop(dst, idx, p->v.vtype, VALget(&p->v));
-}
-
-
-/*
- * The BAThistogram function calculates the frequency distribution of
- * the tail values in its operand bat. Notice, that updates on the
- * result do not affect the delta administration.
- * Construction of a histogram over a string (or complex object) can
- * be sped up using the reference information in the BUN and bulk
- * copying the heap.
- *
- * There are separate versions for each type, and for each a hash- and
- * a merge-algorithms.
- */
-#define histoloop_sorted(BUNtail, cmpfnc, TYPE)                        \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to