Changeset: f5391f7b2694 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5391f7b2694
Added Files:
        sql/backends/monet5/Tests/rapi17.sql
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        configure.ag
        sql/backends/monet5/Tests/All
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql.h
        sql/backends/monet5/sql.mal
Branch: embedded
Log Message:

merge with default


diffs (207 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
@@ -40640,12 +40640,6 @@ pattern sql.mvc():int
 address SQLmvc;
 comment Get the multiversion catalog context. Needed for correct statement 
dependencies(ie sql.update, should be after sql.bind in concurrent execution)
 
-command sql.not_uniques(b:bat[:oid,:wrd]):bat[:oid,:oid] 
-address not_unique_oids;
-command sql.not_uniques(b:bat[:oid,:oid]):bat[:oid,:oid] 
-address not_unique_oids;
-comment return not unique oids
-
 command sql.not_unique(b:bat[:oid,:oid]):bit 
 address not_unique;
 comment check if the tail sorted bat b doesn't have unique tail values
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -51575,12 +51575,6 @@ pattern sql.mvc():int
 address SQLmvc;
 comment Get the multiversion catalog context. Needed for correct statement 
dependencies(ie sql.update, should be after sql.bind in concurrent execution)
 
-command sql.not_uniques(b:bat[:oid,:wrd]):bat[:oid,:oid] 
-address not_unique_oids;
-command sql.not_uniques(b:bat[:oid,:oid]):bat[:oid,:oid] 
-address not_unique_oids;
-comment return not unique oids
-
 command sql.not_unique(b:bat[:oid,:oid]):bit 
 address not_unique;
 comment check if the tail sorted bat b doesn't have unique tail values
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1885,8 +1885,8 @@ if test "x$have_pthread" != xno; then
        save_LIBS="$LIBS"
        save_CPPFLAGS="$CPPFLAGS"
        case $GCC-$have_pthread-$CC_ver in
-               
yes-auto-clang-5.*|yes-yes-clang-5.*|yes-auto-clang-6.*|yes-yes-clang-6.*)
-                       # clang 5.*/6.* (Xcode 6.0) does not
+               
yes-auto-clang-5.*|yes-yes-clang-5.*|yes-auto-clang-6.*|yes-yes-clang-6.*|yes-auto-clang-7.*|yes-yes-clang-7.*)
+                       # clang 5.*/6.*/7.* (Xcode 6.0) does not
                        # seem to have / require -pthread as compiler
                        # option; on Mac OS X Yosamite, "Apple LLVM 
                        # version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)"
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -16,6 +16,7 @@ HAVE_LIBR?rapi13
 HAVE_LIBR?rapi14
 HAVE_LIBR?rapi15
 HAVE_LIBR?rapi16
+HAVE_LIBR?rapi17
 
 # should this work?
 #inlineUDF
diff --git a/sql/backends/monet5/Tests/rapi17.sql 
b/sql/backends/monet5/Tests/rapi17.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/rapi17.sql
@@ -0,0 +1,4 @@
+START TRANSACTION;
+create function dt(d date) returns string language R { class(d) };
+select dt( cast('2015-09-21' as date) );
+ROLLBACK;
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3602,109 +3602,6 @@ not_unique(bit *ret, const bat *bid)
        return MAL_SUCCEED;
 }
 
-/* later we could optimize this to start from current BUN 
-   And only search the from the first if second is not found.
- */
-static inline int
-HASHfndTwice(BAT *b, ptr v)
-{
-       BATiter bi = bat_iterator(b);
-       BUN i = BUN_NONE;
-       int first = 1;
-
-       HASHloop(bi, b->T->hash, i, v) {
-               if (!first)
-                       return 1;
-               first = 0;
-       }
-       return 0;
-}
-
-str
-not_unique_oids(bat *ret, const bat *bid)
-{
-       BAT *b, *bn = NULL;
-
-       if ((b = BATdescriptor(*bid)) == NULL) {
-               throw(SQL, "not_uniques", "Cannot access descriptor");
-       }
-       if (b->ttype != TYPE_oid && b->ttype != TYPE_wrd) {
-               throw(SQL, "not_uniques", "Wrong types");
-       }
-
-       assert(b->htype == TYPE_oid);
-       if (BATtkey(b) || BATtdense(b) || BATcount(b) <= 1) {
-               bn = BATnew(TYPE_void, TYPE_void, 0, TRANSIENT);
-               if (bn == NULL) {
-                       BBPunfix(b->batCacheid);
-                       throw(SQL, "sql.not_uniques", MAL_MALLOC_FAIL);
-               }
-               BATseqbase(bn, 0);
-               BATseqbase(BATmirror(bn), 0);
-       } else if (b->tsorted) {        /* ugh handle both wrd and oid types */
-               oid c = *(oid *) Tloc(b, BUNfirst(b)), *rf, *rh, *rt;
-               oid *h = (oid *) Hloc(b, 0), *vp, *ve;
-               int first = 1;
-
-               bn = BATnew(TYPE_oid, TYPE_oid, BATcount(b), TRANSIENT);
-               if (bn == NULL) {
-                       BBPunfix(b->batCacheid);
-                       throw(SQL, "sql.not_uniques", MAL_MALLOC_FAIL);
-               }
-               vp = (oid *) Tloc(b, BUNfirst(b));
-               ve = vp + BATcount(b);
-               rf = rh = (oid *) Hloc(bn, BUNfirst(bn));
-               rt = (oid *) Tloc(bn, BUNfirst(bn));
-               *rh++ = *h++;
-               *rt++ = *vp;
-               for (vp++; vp < ve; vp++, h++) {
-                       oid v = *vp;
-                       if (v == c) {
-                               first = 0;
-                               *rh++ = *h;
-                               *rt++ = v;
-                       } else if (!first) {
-                               first = 1;
-                               *rh++ = *h;
-                               *rt++ = v;
-                       } else {
-                               *rh = *h;
-                               *rt = v;
-                       }
-                       c = v;
-               }
-               if (first)
-                       rh--;
-               BATsetcount(bn, (BUN) (rh - rf));
-       } else {
-               oid *rf, *rh, *rt;
-               oid *h = (oid *) Hloc(b, 0), *vp, *ve;
-
-               if (BAThash(b, 0) != GDK_SUCCEED)
-                       throw(SQL, "not_uniques", "hash creation failed");
-               bn = BATnew(TYPE_oid, TYPE_oid, BATcount(b), TRANSIENT);
-               if (bn == NULL) {
-                       BBPunfix(b->batCacheid);
-                       throw(SQL, "sql.unique_oids", MAL_MALLOC_FAIL);
-               }
-               vp = (oid *) Tloc(b, BUNfirst(b));
-               ve = vp + BATcount(b);
-               rf = rh = (oid *) Hloc(bn, BUNfirst(bn));
-               rt = (oid *) Tloc(bn, BUNfirst(bn));
-               for (; vp < ve; vp++, h++) {
-                       /* try to find value twice */
-                       if (HASHfndTwice(b, vp)) {
-                               *rh++ = *h;
-                               *rt++ = *vp;
-                       }
-               }
-               BATsetcount(bn, (BUN) (rh - rf));
-       }
-       BBPunfix(b->batCacheid);
-       BBPkeepref(*ret = bn->batCacheid);
-       return MAL_SUCCEED;
-}
-
 /* row case */
 str
 SQLidentity(oid *ret, const void *i)
diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -125,7 +125,6 @@ sql5_export str mvc_getVersion(lng *r, c
 sql5_export str mvc_restart_seq(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 sql5_export str zero_or_one(ptr ret, const bat *bid);
 sql5_export str not_unique(bit *ret, const bat *bid);
-sql5_export str not_unique_oids(bat *ret, const bat *bid);
 sql5_export str SQLshrink(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 sql5_export str SQLreuse(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 sql5_export str SQLvacuum(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
diff --git a/sql/backends/monet5/sql.mal b/sql/backends/monet5/sql.mal
--- a/sql/backends/monet5/sql.mal
+++ b/sql/backends/monet5/sql.mal
@@ -395,13 +395,6 @@ command not_unique( b:bat[:oid,:oid]) :b
 address not_unique 
 comment "check if the tail sorted bat b doesn't have unique tail values" ;
 
-command not_uniques( b:bat[:oid,:oid]) :bat[:oid,:oid] 
-address not_unique_oids 
-comment "return not unique oids" ;
-
-command not_uniques( b:bat[:oid,:wrd]) :bat[:oid,:oid] 
-address not_unique_oids ;
-
 command optimizers()(:bat[:oid,:str],:bat[:oid,:str],:bat[:oid,:str])
 address getPipeCatalog;
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to