Changeset: 395873282fb8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=395873282fb8
Modified Files:
        clients/Tests/exports.stable.out
        gdk/ChangeLog
        gdk/gdk.h
        gdk/gdk_aggr.c
        gdk/gdk_align.c
        gdk/gdk_bat.c
        gdk/gdk_batop.c
        gdk/gdk_bbp.c
        gdk/gdk_calc.c
        gdk/gdk_cross.c
        gdk/gdk_delta.c
        gdk/gdk_delta.h
        gdk/gdk_firstn.c
        gdk/gdk_group.c
        gdk/gdk_hash.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
        gdk/gdk_logger.c
        gdk/gdk_private.h
        gdk/gdk_project.c
        gdk/gdk_sample.c
        gdk/gdk_select.c
        gdk/gdk_storage.c
        geom/monetdb5/geom.c
        geom/monetdb5/geomBulk.c
        monetdb5/mal/Tests/tst275.stable.out
        monetdb5/mal/mal_authorize.c
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/kernel/status.c
        monetdb5/modules/mal/batcalc.c
        monetdb5/modules/mal/bbp.c
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/inspect.c
        monetdb5/modules/mal/mal_io.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/mdb.c
        monetdb5/modules/mal/mkey.c
        monetdb5/modules/mal/orderidx.c
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/projectionpath.c
        monetdb5/modules/mal/tablet.c
        sql/backends/monet5/LSST/lsst.c
        sql/backends/monet5/UDF/udf.c
        sql/backends/monet5/gsl/gsl.c
        sql/backends/monet5/sql_fround_impl.h
        sql/backends/monet5/sql_round_impl.h
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/lidar/lidar.c
        sql/storage/bat/bat_storage.c
        sql/storage/bat/bat_table.c
        sql/storage/bat/bat_utils.c
Branch: default
Log Message:

WE ARE HEADLESS!
Completely removed the head column and the H structure in the BAT
descriptor.


diffs (truncated from 3153 to 300 lines):

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
@@ -158,7 +158,7 @@ BAT *BATproject(BAT *l, BAT *r);
 BAT *BATprojectchain(BAT **bats);
 gdk_return BATrangejoin(BAT **r1p, BAT **r2p, BAT *l, BAT *rl, BAT *rh, BAT 
*sl, BAT *sr, int li, int hi, BUN estimate);
 gdk_return BATreplace(BAT *b, BAT *p, BAT *n, bit force);
-void BATroles(BAT *b, const char *hnme, const char *tnme);
+void BATroles(BAT *b, const char *tnme);
 BAT *BATsample(BAT *b, BUN n);
 gdk_return BATsave(BAT *b);
 BAT *BATselect(BAT *b, BAT *s, const void *tl, const void *th, int li, int hi, 
int anti);
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -1,6 +1,14 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Wed Jun 29 2016 Sjoerd Mullender <sjo...@acm.org>
+- Changed BATroles by removing the argument to set the name of the
+  head column.
+- The head column is now completely gone.  MonetDB is completely
+  "headless".
+- The format of the BBP.dir file was simplified.  Since the head column
+  is VOID, the only value that needs to be stored is the head seqbase.
+
 * Tue Jun 28 2016 Sjoerd Mullender <sjo...@acm.org>
 - BATs now only have a single (logical) name.
 - The function BATmirror is gone.  The HEAD column is always VOID (with
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -781,20 +781,6 @@ gdk_export int VALisnil(const ValRecord 
  *           BUN    batFirst;         // empty BUN before the first alive BUN
  *           BUN    batInserted;      // first inserted BUN
  *           BUN    batCount;         // Tuple count
- *           // Head properties
- *           int    htype;            // Head type number
- *           str    hident;           // name for head column
- *           bit    hkey;             // head values should be unique?
- *           bit    hsorted;          // are head values currently ordered?
- *           bit    hvarsized;        // for speed: head type is varsized?
- *           bit    hnonil;           // head has no nils
- *           oid    halign;           // alignment OID for head.
- *           // Head storage
- *           int    hloc;             // byte-offset in BUN for head elements
- *           Heap   *hheap;           // heap for varsized head values
- *           Hash   *hhash;           // linear chained hash table on head
- *           Imprints *himprints;     // column imprints index on head
- *           orderidx horderidx;      // order oid index on head
  *           // Tail properties
  *           int    ttype;            // Tail type number
  *           str    tident;           // name for tail column
@@ -897,9 +883,9 @@ typedef struct {
 typedef struct BAT {
        /* static bat properties */
        bat batCacheid;         /* index into BBP */
+       oid hseqbase;           /* head seq base */
 
        /* dynamic column properties */
-       COLrec *H;              /* column info */
        COLrec *T;              /* column info */
 
        BATrec *S;              /* the BAT properties */
@@ -932,25 +918,15 @@ typedef int (*GDKfcn) ();
 #define batRestricted  S->restricted
 #define batRole                S->role
 #define creator_tid    S->tid
-#define htype          H->type
 #define ttype          T->type
-#define hkey           H->key
 #define tkey           T->key
-#define hvarsized      H->varsized
 #define tvarsized      T->varsized
-#define hseqbase       H->seq
 #define tseqbase       T->seq
-#define hsorted                H->sorted
-#define hrevsorted     H->revsorted
 #define tsorted                T->sorted
 #define trevsorted     T->revsorted
-#define hdense         H->dense
 #define tdense         T->dense
-#define hident         H->id
 #define tident         T->id
-#define halign         H->align
 #define talign         T->align
-#define horderidx      H->orderidx
 #define torderidx      T->orderidx
 
 
@@ -1293,7 +1269,6 @@ gdk_export bte ATOMelmshift(int sz);
 #define bunfastapp(b, t)                                               \
        do {                                                            \
                register BUN _p = BUNlast(b);                           \
-               assert((b)->htype == TYPE_void);                        \
                if (_p >= BATcapacity(b)) {                             \
                        if (_p == BUN_MAX || BATcount(b) == BUN_MAX) {  \
                                GDKerror("bunfastapp: too many elements to 
accomodate (" BUNFMT ")\n", BUN_MAX); \
@@ -1334,8 +1309,6 @@ gdk_export BUN BUNfnd(BAT *b, const void
         BUN_NONE :                                                     \
         BUNfirst((b)) + (BUN) (*(const oid*)(v) - (b)->tseqbase))
 
-#define BAThtype(b)    ((b)->htype == TYPE_void && (b)->hseqbase != oid_nil ? \
-                        TYPE_oid : (b)->htype)
 #define BATttype(b)    ((b)->ttype == TYPE_void && (b)->tseqbase != oid_nil ? \
                         TYPE_oid : (b)->ttype)
 #define Tbase(b)       ((b)->T->vheap->base)
@@ -1472,7 +1445,7 @@ gdk_export void BATsetcount(BAT *b, BUN 
 gdk_export BUN BATgrows(BAT *b);
 gdk_export gdk_return BATkey(BAT *b, int onoff);
 gdk_export gdk_return BATmode(BAT *b, int onoff);
-gdk_export void BATroles(BAT *b, const char *hnme, const char *tnme);
+gdk_export void BATroles(BAT *b, const char *tnme);
 gdk_export int BATname(BAT *b, const char *nme);
 gdk_export void BAThseqbase(BAT *b, oid o);
 gdk_export void BATtseqbase(BAT *b, oid o);
@@ -1482,7 +1455,7 @@ gdk_export int BATgetaccess(BAT *b);
 
 #define BATdirty(b)    ((b)->batCopiedtodisk == 0 || (b)->batDirty ||  \
                         (b)->batDirtydesc ||                           \
-                        (b)->H->heap.dirty || (b)->T->heap.dirty ||    \
+                        (b)->T->heap.dirty ||                          \
                         ((b)->T->vheap?(b)->T->vheap->dirty:0))
 
 #define PERSISTENT             0
@@ -1600,15 +1573,10 @@ gdk_export gdk_return BATsort(BAT **sort
 gdk_export void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, 
int ts, int tpe);
 gdk_export void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int 
hs, int ts, int tpe);
 
-#define BAThordered(b) ((b)->htype == TYPE_void || (b)->hsorted)
 #define BATtordered(b) ((b)->ttype == TYPE_void || (b)->tsorted)
-#define BAThrevordered(b) (((b)->htype == TYPE_void && (b)->hseqbase == 
oid_nil) || (b)->hrevsorted)
 #define BATtrevordered(b) (((b)->ttype == TYPE_void && (b)->tseqbase == 
oid_nil) || (b)->trevsorted)
-#define BAThdense(b)   (BAThvoid(b) && (b)->hseqbase != oid_nil)
 #define BATtdense(b)   (BATtvoid(b) && (b)->tseqbase != oid_nil)
-#define BAThvoid(b)    (((b)->hdense && (b)->hsorted) || (b)->htype==TYPE_void)
 #define BATtvoid(b)    (((b)->tdense && (b)->tsorted) || (b)->ttype==TYPE_void)
-#define BAThkey(b)     (b->hkey != FALSE || BAThdense(b))
 #define BATtkey(b)     (b->tkey != FALSE || BATtdense(b))
 
 /* set some properties that are trivial to deduce */
@@ -1664,10 +1632,8 @@ gdk_export void GDKqsort_rev(void *h, vo
        } while (0)
 #define BATsettrivprop(b)                                              \
        do {                                                            \
-               assert((b)->htype == TYPE_void);                        \
                assert((b)->hseqbase != oid_nil);                       \
                (b)->batDirtydesc = 1;  /* likely already set */        \
-               (b)->hrevsorted = (b)->batCount <= 1;                   \
                /* the other head properties should already be correct */ \
                COLsettrivprop((b), (b)->T);                            \
        } while (0)
@@ -2751,8 +2717,8 @@ gdk_export void VIEWbounds(BAT *b, BAT *
 gdk_export void ALIGNsetH(BAT *b1, BAT *b2);
 gdk_export void ALIGNsetT(BAT *b1, BAT *b2);
 
-#define ALIGNins(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ,e);(x)->halign=(x)->talign=0; } while (0)
-#define ALIGNdel(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ|BAT_APPEND,e);(x)->halign=(x)->talign=0; } while (0)
+#define ALIGNins(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ,e);(x)->talign=0; } while (0)
+#define ALIGNdel(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ|BAT_APPEND,e);(x)->talign=0; } while (0)
 #define ALIGNinp(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ|BAT_APPEND,e);(x)->talign=0; } while (0)
 #define ALIGNapp(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ,e);(x)->talign=0; } while (0)
 
@@ -2778,7 +2744,7 @@ gdk_export void ALIGNsetT(BAT *b1, BAT *
  * correct for the reversed view.
  */
 #define isVIEW(x)                                                      \
-       (assert((x)->batCacheid > 0 && (x)->htype == TYPE_void),        \
+       (assert((x)->batCacheid > 0),                                   \
         ((x)->T->heap.parentid ||                                      \
          ((x)->T->vheap && (x)->T->vheap->parentid != (x)->batCacheid)))
 
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -70,16 +70,14 @@ BATgroupaggrinit(BAT *b, BAT *g, BAT *e,
        BUN start, end, cnt;
        const oid *cand = NULL, *candend = NULL;
 
-       if (b == NULL || !BAThdense(b))
-               return "b must be dense-headed";
+       if (b == NULL)
+               return "b must exist";
        if (g) {
-               if (!BAThdense(g) || BATcount(b) != BATcount(g) ||
+               if (BATcount(b) != BATcount(g) ||
                    (BATcount(b) != 0 && b->hseqbase != g->hseqbase))
                        return "b and g must be aligned";
                assert(BATttype(g) == TYPE_oid);
        }
-       if (e != NULL && !BAThdense(e))
-               return "e must be dense-headed";
        if (g == NULL) {
                min = 0;
                max = 0;
@@ -2285,8 +2283,6 @@ BATminmax(BAT *b, void *aggr,
        int needdecref = 0;
        BATiter bi;
 
-       if (!BAThdense(b))
-               return NULL;
        if ((VIEWtparent(b) == 0 ||
             BATcount(b) == BATcount(BBPdescriptor(-VIEWtparent(b)))) &&
            BATcheckimprints(b)) {
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -58,9 +58,8 @@
  * leftmost 4 bits are for the head, the rightmost 4 for the
  * tail. This has been done to make the zap ultra-cheap.
  *
- * Both head and tail column contain an OID in the @emph{halign} and
- * @emph{talign} fields respectively to mark their alignment
- * group. All BATs with the same OID in this field (and the
+ * Columns contain an OID in the @emph{talign} field to mark their
+ * alignment group. All BATs with the same OID in this field (and the
  * ALIGN_SYNCED bit on) are guaranteed by the system to have equal
  * head columns. As an exception, they might also have TYPE_void head
  * columns (a virtual column).  In such a case, the tail values
@@ -77,9 +76,6 @@ ALIGNcommit(BAT *b)
 {
        if (b == NULL)
                return;
-       if (!b->halign) {
-               b->halign = OIDnew(1);
-       }
        if (!b->talign) {
                b->talign = OIDnew(1);
        }
@@ -91,24 +87,9 @@ ALIGNsetH(BAT *b1, BAT *b2)
        if (b1 == NULL || b2 == NULL)
                return;
 
-       assert(b1->htype == TYPE_void);
-       assert(b2->htype == TYPE_void);
-
-       if (b2->halign == 0) {
-               b2->halign = OIDnew(1);
-               b2->batDirtydesc = TRUE;
-       }
        /* b2 is either dense or has a void(nil) tail */
        BAThseqbase(b1, b2->hseqbase);
-       b1->halign = b2->halign;
        b1->batDirtydesc = TRUE;
-
-       assert(b1->hkey & 1);
-       assert(b2->hkey & 1);
-       assert(b1->hsorted);
-       assert(b2->hsorted);
-       assert(b1->hrevsorted == (BATcount(b1) <= 1));
-       assert(b2->hrevsorted == (BATcount(b2) <= 1));
 }
 
 void
@@ -165,8 +146,6 @@ ALIGNsynced(BAT *b1, BAT *b2)
        BATcheck(b1, "ALIGNsynced: bat 1 required", 0);
        BATcheck(b2, "ALIGNsynced: bat 2 required", 0);
 
-       assert(b1->htype == TYPE_void);
-       assert(b2->htype == TYPE_void);
        assert(b1->hseqbase != oid_nil);
        assert(b2->hseqbase != oid_nil);
 
@@ -197,8 +176,6 @@ VIEWcreate_(oid seq, BAT *b, int slice_v
 
        BATcheck(b, "VIEWcreate_", NULL);
 
-       assert(b->htype == TYPE_void);
-
        bs = BATcreatedesc(seq, b->ttype, FALSE, TRANSIENT);
        if (bs == NULL)
                return NULL;
@@ -208,10 +185,10 @@ VIEWcreate_(oid seq, BAT *b, int slice_v
        if ((tp == 0 && b->ttype != TYPE_void) || b->T->heap.copied)
                tp = b->batCacheid;
        assert(b->ttype != TYPE_void || !tp);
-       /* the H and T column descriptors are fully copied. We need
-        * copies because in case of a mark, we are going to override
-        * a column with a void. Take care to zero the accelerator
-        * data, though. */
+       /* the T column descriptor is fully copied. We need copies
+        * because in case of a mark, we are going to override a
+        * column with a void. Take care to zero the accelerator data,
+        * though. */
        bn->batDeleted = b->batDeleted;
        bn->batFirst = b->batFirst;
        bn->batInserted = b->batInserted;
@@ -251,10 +228,8 @@ VIEWcreate_(oid seq, BAT *b, int slice_v
        else
                bn->T->hash = b->T->hash;
        /* imprints are shared, but the check is dynamic */
-       bn->H->imprints = NULL;
        bn->T->imprints = NULL;
        /* Order OID index */
-       bn->horderidx = NULL;
        bn->torderidx = NULL;
        BBPcacheit(bs, 1);      /* enter in BBP */
        return bn;
@@ -345,7 +320,6 @@ VIEWunlink(BAT *b)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to