Changeset: 3f5bbbfb5701 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3f5bbbfb5701 Modified Files: clients/Tests/exports.stable.out configure.ag 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_bbp.h gdk/gdk_calc.c gdk/gdk_calc_compare.h gdk/gdk_cand.h 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_hash.h gdk/gdk_imprints.c gdk/gdk_join.c gdk/gdk_logger.c gdk/gdk_orderidx.c gdk/gdk_private.h gdk/gdk_project.c gdk/gdk_sample.c gdk/gdk_select.c gdk/gdk_storage.c gdk/gdk_unique.c gdk/gdk_utils.c geom/monetdb5/geom.c geom/monetdb5/geomBulk.c geom/monetdb5/geom_upgrade.c monetdb5/ChangeLog monetdb5/extras/pyapi/connection.c monetdb5/extras/pyapi/pyapi.c monetdb5/extras/rapi/converters.c.h monetdb5/extras/rapi/rapi.c monetdb5/extras/sphinx/sphinx.c monetdb5/mal/mal_authorize.c monetdb5/mal/mal_debugger.c monetdb5/mal/mal_interpreter.c monetdb5/mal/mal_listing.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_recycle.c monetdb5/mal/mal_resource.c monetdb5/mal/mal_runtime.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/json.c monetdb5/modules/atoms/mtime.c monetdb5/modules/atoms/str.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/bat5.h monetdb5/modules/kernel/batcolor.c monetdb5/modules/kernel/batmmath.c monetdb5/modules/kernel/batstr.c monetdb5/modules/kernel/microbenchmark.c monetdb5/modules/kernel/status.c monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/batcalc.c monetdb5/modules/mal/bbp.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/inspect.c monetdb5/modules/mal/iterator.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/manual.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/querylog.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/sysmon.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/tokenizer.c monetdb5/modules/mal/txtsim.c monetdb5/modules/mal/zorder.c monetdb5/optimizer/opt_pipes.c monetdb5/optimizer/opt_statistics.c sql/backends/monet5/LSST/lsst.c sql/backends/monet5/UDF/udf.c sql/backends/monet5/generator/generator.c sql/backends/monet5/gsl/gsl.c sql/backends/monet5/sql.c sql/backends/monet5/sql_bat2time.c sql/backends/monet5/sql_cast.c sql/backends/monet5/sql_cast_impl_down_from_flt.h sql/backends/monet5/sql_cast_impl_down_from_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_cast_impl_up_to_int.h sql/backends/monet5/sql_fround_impl.h sql/backends/monet5/sql_rank.c sql/backends/monet5/sql_result.c sql/backends/monet5/sql_round_impl.h sql/backends/monet5/vaults/bam/bam_lib.c sql/backends/monet5/vaults/fits/fits.c sql/backends/monet5/vaults/lidar/lidar.c sql/backends/monet5/vaults/netcdf/netcdf.c sql/backends/monet5/vaults/shp/shp.c sql/storage/bat/bat_logger.c sql/storage/bat/bat_storage.c sql/storage/bat/bat_table.c sql/storage/bat/bat_utils.c sql/storage/bat/bat_utils.h sql/storage/bat/res_table.c testing/Makefile.ag Branch: sfcgal Log Message:
Merge with default diffs (truncated from 14296 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 @@ -7,6 +7,7 @@ stdout of test 'exports` in directory 'c # gdk void ALIGNsetH(BAT *b1, BAT *b2); +void ALIGNsetT(BAT *b1, BAT *b2); int ALIGNsynced(BAT *b1, BAT *b2); int ATOMallocate(const char *nme); int ATOMcmp(int id, const void *v_1, const void *v_2); @@ -132,6 +133,7 @@ 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); gdk_return BAThash(BAT *b, BUN masksize); +void BAThseqbase(BAT *b, oid o); gdk_return BATimprints(BAT *b); BAT *BATintersectcand(BAT *a, BAT *b); gdk_return BATjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int nil_matches, BUN estimate); @@ -144,7 +146,6 @@ void *BATmin(BAT *b, void *aggr); gdk_return BATmode(BAT *b, int onoff); void BATmsync(BAT *b); int BATname(BAT *b, const char *nme); -BAT *BATnew(int hdtype, int tltype, BUN capacity, int role) __attribute__((warn_unused_result)); int BATordered(BAT *b); int BATordered_rev(BAT *b); gdk_return BATorderidx(BAT *b, int stable); @@ -162,7 +163,6 @@ 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); gdk_return BATsemijoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int nil_matches, BUN estimate); -void BATseqbase(BAT *b, oid o); gdk_return BATsetaccess(BAT *b, int mode); void BATsetcapacity(BAT *b, BUN cnt); void BATsetcount(BAT *b, BUN cnt); @@ -173,6 +173,7 @@ gdk_return BATsubcross(BAT **r1p, BAT ** gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, int skip_nils, int abort_on_error, int nil_if_empty); gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int op, int nil_matches, BUN estimate); BAT *BATthetaselect(BAT *b, BAT *s, const void *val, const char *op); +void BATtseqbase(BAT *b, oid o); void BATundo(BAT *b); BAT *BATunique(BAT *b, BAT *s); BBPrec *BBP[N_BBPINIT]; @@ -205,6 +206,7 @@ gdk_return BUNdelete(BAT *b, oid o); BUN BUNfnd(BAT *b, const void *right); gdk_return BUNinplace(BAT *b, BUN p, const void *right, bit force); BAT *COLcopy(BAT *b, int tt, int writeable, int role); +BAT *COLnew(oid hseq, int tltype, BUN capacity, int role) __attribute__((warn_unused_result)); size_t GDK_mem_maxsize; size_t GDK_vm_maxsize; int GDK_vm_trim; @@ -768,7 +770,6 @@ str BATXMLxml2str(bat *ret, const bat *b str BATXMLxmltext(bat *ret, const bat *bid); str BATXMLxquery(bat *ret, const bat *bid, const char *const *expr); str BKCappend_force_wrap(bat *r, const bat *bid, const bat *uid, const bit *force); -str BKCappend_reverse_val_wrap(bat *r, const bat *bid, const void *u); str BKCappend_val_force_wrap(bat *r, const bat *bid, const void *u, const bit *force); str BKCappend_val_wrap(bat *r, const bat *bid, const void *u); str BKCappend_wrap(bat *r, const bat *bid, const bat *uid); diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2749,16 +2749,16 @@ AC_SUBST(GEOS_INCS) AC_SUBST(GEOS_LIBS) # fits, only used by sql -org_have_cfitsio=no -have_cfitsio=$org_have_cfitsio +org_have_fits=no +have_fits=$org_have_fits if test "x$enable_fits" != xno; then PKG_CHECK_MODULES([cfitsio], [cfitsio], - [have_cfitsio=yes; AC_DEFINE(HAVE_FITS, 1, [Define if the fits module is to be enabled])], - [have_cfitsio=no; why_have_cfitsio="(cfitsio library not found)" + [have_fits="yes"; AC_DEFINE(HAVE_FITS, 1, [Define if the fits module is to be enabled])], + [have_fits="no"; why_have_fits="(cfitsio library not found)" if test "x$enable_fits" = xyes; then AC_MSG_ERROR([cfitsio library required for FITS support]); fi; enable_fits=no; disable_fits="(cfitsio library not found)"]) fi -AM_CONDITIONAL(HAVE_FITS, test x"$have_cfitsio" != xno) +AM_CONDITIONAL(HAVE_FITS, test x"$have_fits" != xno) # netcdf, only used by sql org_have_netcdf=no diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -1,6 +1,23 @@ # ChangeLog file for MonetDB # This file is updated with Maddlog +* 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 + a non-nil seqbase) and the TAIL column carries the data. All functions + that deal with data work on the TAIL column. + +* Mon Jun 27 2016 Sjoerd Mullender <sjo...@acm.org> +- BATkey now works on the TAIL column instead of the HEAD column. +- Replaced BATseqbase with BAThseqbase and BATtseqbase, the former for + setting the seqbase on the HEAD, the latter for setting the seqbase + on the TAIL. + +* Fri Jun 24 2016 Sjoerd Mullender <sjo...@acm.org> +- Replaced function BATnew with COLnew with slightly different arguments: + the first argument of COLnew is the SEQBASE of the head column (which + is always VOID). + * Thu May 26 2016 Sjoerd Mullender <sjo...@acm.org> - The "wrd" type has been removed from GDK and MAL. The type was defined to be a 32 bit integer on 32 bit architectures and a 64 bit integer diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -816,12 +816,6 @@ gdk_export int VALisnil(const ValRecord * more complex, but GDK programmers should refrain of making use of * that. * - * The reason for this complex structure is to allow for a BAT to - * exist in two incarnations at the time: the @emph{normal view} and - * the @emph{reversed view}. Each bat @emph{b} has a - * BATmirror(@emph{b}) which has the negative @strong{cacheid} of b in - * the BBP. - * * Since we don't want to pay cost to keep both views in line with * each other under BAT updates, we work with shared pieces of memory * between the two views. An update to one will thus automatically @@ -894,12 +888,11 @@ typedef struct { /* assert that atom width is power of 2, i.e., width == 1<<shift */ #define assert_shift_width(shift,width) assert(((shift) == 0 && (width) == 0) || ((unsigned)1<<(shift)) == (unsigned)(width)) -#define GDKLIBRARY_INET_COMPARE 061026 /* version with missing inet cmp func */ -#define GDKLIBRARY_64_BIT_INT 061027 /* version that had no 128-bit integer option, yet */ #define GDKLIBRARY_SORTEDPOS 061030 /* version where we can't trust no(rev)sorted */ #define GDKLIBRARY_OLDWKB 061031 /* old geom WKB format */ #define GDKLIBRARY_INSERTED 061032 /* inserted and deleted in BBP.dir */ -#define GDKLIBRARY 061033 +#define GDKLIBRARY_HEADED 061033 /* head properties are stored */ +#define GDKLIBRARY 061034 typedef struct BAT { /* static bat properties */ @@ -1045,12 +1038,12 @@ gdk_export void HEAP_free(Heap *heap, va * @- BAT construction * @multitable @columnfractions 0.08 0.7 * @item @code{BAT* } - * @tab BATnew (int headtype, int tailtype, BUN cap, int role) + * @tab COLnew (oid headseq, int tailtype, BUN cap, int role) * @item @code{BAT* } * @tab BATextend (BAT *b, BUN newcap) * @end multitable * - * A temporary BAT is instantiated using BATnew with the type aliases + * A temporary BAT is instantiated using COLnew with the type aliases * of the required binary association. The aliases include the * built-in types, such as TYPE_int....TYPE_ptr, and the atomic types * introduced by the user. The initial capacity to be accommodated @@ -1063,7 +1056,7 @@ gdk_export void HEAP_free(Heap *heap, va */ #define BATDELETE (-9999) -gdk_export BAT *BATnew(int hdtype, int tltype, BUN capacity, int role) +gdk_export BAT *COLnew(oid hseq, int tltype, BUN capacity, int role) __attribute__((warn_unused_result)); gdk_export BAT *BATdense(oid hseq, oid tseq, BUN cnt) __attribute__((warn_unused_result)); @@ -1086,8 +1079,6 @@ gdk_export bte ATOMelmshift(int sz); * @item BUN * @tab BUNlocate (BAT *b, ptr head, ptr tail) * @item ptr - * @tab BUNhead (BAT *b, BUN p) - * @item ptr * @tab BUNtail (BAT *b, BUN p) * @end multitable * @@ -1110,13 +1101,10 @@ gdk_export bte ATOMelmshift(int sz); * The routine BUNfnd provides fast access to a single BUN providing a * value for the tail of the binary association. * - * To select on a tail, one should use the reverse view obtained by - * BATmirror. - * - * The routines BUNhead and BUNtail return a pointer to the first and - * second value in an association, respectively. To guard against - * side effects on the BAT, one should normally copy this value into a - * scratch variable for further processing. + * The routine BUNtail returns a pointer to the second value in an + * association. To guard against side effects on the BAT, one should + * normally copy this value into a scratch variable for further + * processing. * * Behind the interface we use several macros to access the BUN fixed * part and the variable part. The BUN operators always require a BAT @@ -1129,15 +1117,6 @@ gdk_export bte ATOMelmshift(int sz); * @item * BUNlast(b) returns the BUN pointer directly after the last BUN * in the BAT. - * @item - * BUNhead(b, p) and BUNtail(b, p) return pointers to the - * head-value and tail-value in a given BUN. - * @item - * BUNhloc(b, p) and BUNtloc(b, p) do the same thing, but knowing - * in advance that the head-atom resp. tail-atom of a BAT is fixed size. - * @item - * BUNhvar(b, p) and BUNtvar(b, p) do the same thing, but knowing - * in advance that the head-atom resp. tail-atom of a BAT is variable sized. * @end itemize */ /* NOTE: `p' is evaluated after a possible upgrade of the heap */ @@ -1359,19 +1338,12 @@ gdk_export BUN BUNfnd(BAT *b, const void TYPE_oid : (b)->htype) #define BATttype(b) ((b)->ttype == TYPE_void && (b)->tseqbase != oid_nil ? \ TYPE_oid : (b)->ttype) -#define BAThstore(b) (BAThdense(b) ? TYPE_void : (b)->htype) -#define BATtstore(b) (BATtdense(b) ? TYPE_void : (b)->ttype) -#define Hbase(b) ((b)->H->vheap->base) #define Tbase(b) ((b)->T->vheap->base) -#define Hsize(b) ((b)->H->width) #define Tsize(b) ((b)->T->width) -/* new semantics ! */ -#define headsize(b,p) ((b)->H->type?((size_t)(p))<<(b)->H->shift:0) -#define tailsize(b,p) ((b)->T->type?((size_t)(p))<<(b)->T->shift:0) +#define tailsize(b,p) ((b)->ttype?((size_t)(p))<<(b)->T->shift:0) -#define Hloc(b,p) ((b)->H->heap.base+((p)<<(b)->H->shift)) #define Tloc(b,p) ((b)->T->heap.base+((p)<<(b)->T->shift)) #if SIZEOF_VAR_T < SIZEOF_VOID_P @@ -1419,16 +1391,11 @@ typedef var_t stridx_t; /* TODO: should ((var_t *) (b))[p]) #endif #define VarHeapVal(b,p,w) ((size_t) VarHeapValRaw(b,p,w) << GDK_VARSHIFT) -#define BUNhvaroff(bi,p) VarHeapVal((bi).b->H->heap.base, (p), (bi).b->H->width) #define BUNtvaroff(bi,p) VarHeapVal((bi).b->T->heap.base, (p), (bi).b->T->width) -#define BUNhloc(bi,p) Hloc((bi).b,p) #define BUNtloc(bi,p) Tloc((bi).b,p) -#define BUNhpos(bi,p) Hpos(&(bi),p) #define BUNtpos(bi,p) Tpos(&(bi),p) -#define BUNhvar(bi,p) (assert((bi).b->htype && (bi).b->hvarsized), Hbase((bi).b)+BUNhvaroff(bi,p)) #define BUNtvar(bi,p) (assert((bi).b->ttype && (bi).b->tvarsized), Tbase((bi).b)+BUNtvaroff(bi,p)) -#define BUNhead(bi,p) ((bi).b->htype?(bi).b->hvarsized?BUNhvar(bi,p):BUNhloc(bi,p):BUNhpos(bi,p)) #define BUNtail(bi,p) ((bi).b->ttype?(bi).b->tvarsized?BUNtvar(bi,p):BUNtloc(bi,p):BUNtpos(bi,p)) static inline BATiter @@ -1507,7 +1474,8 @@ gdk_export gdk_return BATkey(BAT *b, int gdk_export gdk_return BATmode(BAT *b, int onoff); gdk_export void BATroles(BAT *b, const char *hnme, const char *tnme); gdk_export int BATname(BAT *b, const char *nme); -gdk_export void BATseqbase(BAT *b, oid o); +gdk_export void BAThseqbase(BAT *b, oid o); +gdk_export void BATtseqbase(BAT *b, oid o); gdk_export gdk_return BATsetaccess(BAT *b, int mode); gdk_export int BATgetaccess(BAT *b); @@ -1515,7 +1483,6 @@ 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)->H->vheap?(b)->H->vheap->dirty:0) || \ ((b)->T->vheap?(b)->T->vheap->dirty:0)) #define PERSISTENT 0 @@ -1535,20 +1502,12 @@ gdk_export int BATgetaccess(BAT *b); * @tab BATclear (BAT *b, int force) * @item BAT * * @tab COLcopy (BAT *b, int tt, int writeable, int role) - * @item BAT * - * @tab BATmirror (BAT *b) - * @item BAT * * @end multitable * * The routine BATclear removes the binary associations, leading to an * empty, but (re-)initialized BAT. Its properties are retained. A * temporary copy is obtained with Colcopy. The new BAT has an unique * name. - * - * The routine BATmirror returns the mirror image BAT (where tail is - * head and head is tail) of that same BAT. This does not involve a - * state change in the BAT (as previously): both views on the BAT - * exist at the same time. */ gdk_export gdk_return BATclear(BAT *b, int force); gdk_export BAT *COLcopy(BAT *b, int tt, int writeable, int role); @@ -1566,7 +1525,7 @@ gdk_export gdk_return BATgroup(BAT **gro * @tab BATdelete (BAT *b) * @end multitable * - * A BAT created by BATnew is considered temporary until one calls the + * A BAT created by COLnew is considered temporary until one calls the * routine BATsave or BATmode. This routine reserves disk space and * checks for name clashes in the BAT directory. It also makes the BAT * persistent. The empty BAT is initially marked as ordered on both @@ -1705,8 +1664,11 @@ gdk_export void GDKqsort_rev(void *h, vo } while (0) #define BATsettrivprop(b) \ do { \ + assert((b)->htype == TYPE_void); \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list