Changeset: 5d37b81452ca for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5d37b81452ca
Modified Files:
        clients/Tests/MAL-signatures-hge.test
        clients/Tests/MAL-signatures.test
Branch: txtsim
Log Message:

Merge with default.


diffs (truncated from 345 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -49744,6 +49744,21 @@ unsafe pattern sql.setVariable(X_0:int, 
 setVariable;
 Set the value of a session variable
 sql
+sql
+set_count_distinct
+unsafe pattern sql.set_count_distinct(X_0:str, X_1:str, X_2:str, X_3:lng):void
+sql_set_count_distinct;
+Set count distinct for column
+sql
+set_max
+unsafe pattern sql.set_max(X_0:str, X_1:str, X_2:str, X_3:any_1):void
+sql_set_max;
+Set max for column
+sql
+set_min
+unsafe pattern sql.set_min(X_0:str, X_1:str, X_2:str, X_3:any_1):void
+sql_set_min;
+Set min for column
 set_protocol
 unsafe pattern sql.set_protocol(X_0:int):int 
 SQLset_protocol;
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -38124,6 +38124,21 @@ unsafe pattern sql.setVariable(X_0:int, 
 setVariable;
 Set the value of a session variable
 sql
+set_count_distinct
+unsafe pattern sql.set_count_distinct(X_0:str, X_1:str, X_2:str, X_3:lng):void
+sql_set_count_distinct;
+Set count distinct for column
+sql
+set_max
+unsafe pattern sql.set_max(X_0:str, X_1:str, X_2:str, X_3:any_1):void
+sql_set_max;
+Set max for column
+sql
+set_min
+unsafe pattern sql.set_min(X_0:str, X_1:str, X_2:str, X_3:any_1):void
+sql_set_min;
+Set min for column
+sql
 set_protocol
 unsafe pattern sql.set_protocol(X_0:int):int 
 SQLset_protocol;
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -66,7 +66,6 @@ target_link_libraries(stream
   $<$<BOOL:${CURL_FOUND}>:CURL::libcurl>
   $<$<BOOL:${LIBLZMA_FOUND}>:LibLZMA::LibLZMA>
   $<$<BOOL:${LZ4_FOUND}>:LZ4::LZ4>
-  $<$<BOOL:${SNAPPY_FOUND}>:SNAPPY::SNAPPY>
   $<$<BOOL:${Iconv_FOUND}>:Iconv::Iconv>
   matomic
   monetdb_config_header
@@ -100,10 +99,6 @@ if (NOT WIN32)
     set(PKG_LZMA "liblzma")
   endif()
 
-  if(SNAPPY_FOUND)
-    set(PKG_SNAPPY "snappy")
-  endif()
-
   if(ICONV_FOUND AND NOT Iconv_IS_BUILT_IN)
     get_filename_component(ICONV_LIBRARIES_PATH
       "${ICONV_LIBRARIES}"
diff --git a/common/stream/monetdb-stream.pc.in 
b/common/stream/monetdb-stream.pc.in
--- a/common/stream/monetdb-stream.pc.in
+++ b/common/stream/monetdb-stream.pc.in
@@ -14,7 +14,7 @@ Name: monetdb-stream
 Description: MonetDB streams libary
 URL: https://www.monetdb.org/
 Version: @MONETDB_VERSION@
-Requires.private: @PKG_ZLIB@ @PKG_BZIP2@ @PKG_CURL@ @PKG_LZMA@ @PKG_SNAPPY@
+Requires.private: @PKG_ZLIB@ @PKG_BZIP2@ @PKG_CURL@ @PKG_LZMA@
 
 Libs: -L${libdir} -lstream
 Libs.private: @SOCKET_LIBS@ @PKG_LIBICONV@
diff --git a/common/stream/stream_internal.h b/common/stream/stream_internal.h
--- a/common/stream/stream_internal.h
+++ b/common/stream/stream_internal.h
@@ -56,9 +56,6 @@
 #ifdef HAVE_LIBLZMA
 #include <lzma.h>
 #endif
-#ifdef HAVE_SNAPPY
-#include <snappy-c.h>
-#endif
 #ifdef HAVE_LIBLZ4
 #include <lz4.h>
 #include <lz4frame.h>
diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c
--- a/common/utils/mcrypt.c
+++ b/common/utils/mcrypt.c
@@ -40,12 +40,6 @@ mcrypt_getHashAlgorithms(void)
                ",SHA256"
                ",SHA224"
                ",SHA1"
-#ifdef HAVE_SNAPPY
-               ",COMPRESSION_SNAPPY"
-#endif
-#ifdef HAVE_LIBLZ4
-               ",COMPRESSION_LZ4"
-#endif
                ;
        return algorithms;
 }
diff --git a/documentation/source/build-debian.rst 
b/documentation/source/build-debian.rst
--- a/documentation/source/build-debian.rst
+++ b/documentation/source/build-debian.rst
@@ -39,5 +39,5 @@ zlib1g-dev            # optional: read and write .
 These packages are optional.
 
 libcfitsio-dev         # optional: read FITS files
-liblz4-dev             # optional: compression in new (unused) MAPI protocol, 
also used to read and write .lz4 compressed files
-libsnappy-dev          # optional: compression in new (unused) MAPI protocol
+liblz4-dev             # optional: read and write .lz4 compressed files
+libsnappy-dev          # optional: currently unused
diff --git a/documentation/source/build-fedora.rst 
b/documentation/source/build-fedora.rst
--- a/documentation/source/build-fedora.rst
+++ b/documentation/source/build-fedora.rst
@@ -32,17 +32,17 @@ the command make rpm.
 | python3-devel                # optional, needed for Python 3 integration
 | python3-numpy                # optional, needed for Python 3 integration
 | R-core-devel         # optional, needed for R integration
-| readline-devel               # optional, enable editing in mclient
+| readline-devel       # optional, enable editing in mclient
 | rpm-build            # optional, required to create RPMs (make rpm)
 | selinux-policy-devel # optional, required to create RPMs (make rpm)
-| unixODBC-devel               # optional, needed for ODBC driver
+| unixODBC-devel       # optional, needed for ODBC driver
 
 These packages are optional.
 
 | cfitsio-devel                # optional: read FITS files
-| libasan                      # optional: --enable-sanitizer configuration 
(debug)
-| lz4-devel            # optional: compression in new (unused) MAPI protocol, 
also used to read and write .lz4 compressed files
+| libasan              # optional: --enable-sanitizer configuration (debug)
+| lz4-devel            # optional: read and write .lz4 compressed files
 | netcdf-devel         # optional: read NetCDF files
 | proj-devel           # optional, only optionally used in geom module
-| snappy-devel         # optional: compression in new (unused) MAPI protocol
-| valgrind-devel               # optional: --with-valgrind configuration 
(debug)
+| snappy-devel         # optional: unused
+| valgrind-devel       # optional: --with-valgrind configuration (debug)
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1622,6 +1622,25 @@ BATsettrivprop(BAT *b)
        }
 }
 
+static inline void
+BATnegateprops(BAT *b)
+{
+    /* disable all properties here */
+    b->tnonil = false;
+    b->tnil = false;
+    if (b->ttype) {
+        b->tsorted = false;
+        b->trevsorted = false;
+        b->tnosorted = 0;
+        b->tnorevsorted = 0;
+    }
+    b->tseqbase = oid_nil;
+    b->tkey = false;
+    b->tnokey[0] = 0;
+    b->tnokey[1] = 0;
+    b->tmaxpos = b->tminpos = BUN_NONE;
+}
+
 /*
  * @- GDK error handling
  *  @multitable @columnfractions 0.08 0.7
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -716,7 +716,7 @@ DFLOWscheduler(DataFlow flow, struct wor
        int i;
        int j;
        InstrPtr p;
-       int tasks=0, actions;
+       int tasks=0, actions = 0;
        str ret = MAL_SUCCEED;
        FlowEvent fe, f = 0;
 
diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c
--- a/monetdb5/modules/mal/mat.c
+++ b/monetdb5/modules/mal/mat.c
@@ -48,7 +48,7 @@ MATpackInternal(Client cntxt, MalBlkPtr 
 {
        int i;
        bat *ret = getArgReference_bat(stk,p,0);
-       BAT *b, *bn;
+       BAT *b, *bn = NULL;
        BUN cap = 0;
        int tt = TYPE_any;
        int rt = getArgType(mb, p, 0), unmask = 0;
diff --git a/sql/backends/monet5/dict.c b/sql/backends/monet5/dict.c
--- a/sql/backends/monet5/dict.c
+++ b/sql/backends/monet5/dict.c
@@ -25,22 +25,6 @@ get_newcolumn(sql_trans *tr, sql_column 
 }
 
 static void
-BATnegateprops(BAT *b)
-{
-       /* disable all properties here */
-       b->tnonil = false;
-       b->tnil = false;
-       b->tsorted = false;
-       b->trevsorted = false;
-       b->tnosorted = 0;
-       b->tnorevsorted = 0;
-       b->tseqbase = oid_nil;
-       b->tkey = false;
-       b->tnokey[0] = 0;
-       b->tnokey[1] = 0;
-}
-
-static void
 BATmaxminpos_bte(BAT *o, bte m)
 {
        BUN minpos = BUN_NONE, maxpos = BUN_NONE, p, q;
diff --git a/sql/backends/monet5/for.c b/sql/backends/monet5/for.c
--- a/sql/backends/monet5/for.c
+++ b/sql/backends/monet5/for.c
@@ -24,20 +24,6 @@ get_newcolumn(sql_trans *tr, sql_column 
        return NULL;
 }
 
-static void
-BATnegateprops(BAT *b)
-{
-       /* disable all properties here */
-       b->tsorted = false;
-       b->trevsorted = false;
-       b->tnosorted = 0;
-       b->tnorevsorted = 0;
-       b->tseqbase = oid_nil;
-       b->tkey = false;
-       b->tnokey[0] = 0;
-       b->tnokey[1] = 0;
-}
-
 BAT *
 FORdecompress_(BAT *o, lng minval, int type, role_t role)
 {
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
@@ -5153,6 +5153,9 @@ pattern("sql", "decypher", SQLdecypher, 
  pattern("sql", "analyze", sql_analyze, true, "Update statistics for schema", 
args(1,2, arg("",void),arg("sch",str))),
  pattern("sql", "analyze", sql_analyze, true, "Update statistics for table", 
args(1,3, arg("",void),arg("sch",str),arg("tbl",str))),
  pattern("sql", "analyze", sql_analyze, true, "Update statistics for column", 
args(1,4, arg("",void),arg("sch",str),arg("tbl",str),arg("col",str))),
+ pattern("sql", "set_count_distinct", sql_set_count_distinct, true, "Set count 
distinct for column", args(1,5, 
arg("",void),arg("sch",str),arg("tbl",str),arg("col",str),arg("val",lng))),
+ pattern("sql", "set_min", sql_set_min, true, "Set min for column", args(1,5, 
arg("",void),arg("sch",str),arg("tbl",str),arg("col",str),argany("val",1))),
+ pattern("sql", "set_max", sql_set_max, true, "Set max for column", args(1,5, 
arg("",void),arg("sch",str),arg("tbl",str),arg("col",str),argany("val",1))),
  pattern("sql", "statistics", sql_statistics, false, "return a table with 
statistics information", args(13,13, 
batarg("columnid",int),batarg("schema",str),batarg("table",str),batarg("column",str),batarg("type",str),batarg("with",int),batarg("count",lng),batarg("unique",bit),batarg("nils",bit),batarg("minval",str),batarg("maxval",str),batarg("sorted",bit),batarg("revsorted",bit))),
  pattern("sql", "statistics", sql_statistics, false, "return a table with 
statistics information for a particular schema", args(13,14, 
batarg("columnid",int),batarg("schema",str),batarg("table",str),batarg("column",str),batarg("type",str),batarg("with",int),batarg("count",lng),batarg("unique",bit),batarg("nils",bit),batarg("minval",str),batarg("maxval",str),batarg("sorted",bit),batarg("revsorted",bit),arg("sname",str))),
  pattern("sql", "statistics", sql_statistics, false, "return a table with 
statistics information for a particular table", args(13,15, 
batarg("columnid",int),batarg("schema",str),batarg("table",str),batarg("column",str),batarg("type",str),batarg("with",int),batarg("count",lng),batarg("unique",bit),batarg("nils",bit),batarg("minval",str),batarg("maxval",str),batarg("sorted",bit),batarg("revsorted",bit),arg("sname",str),arg("tname",str))),
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -20,6 +20,61 @@ analysis by optimizers.
 #include "monetdb_config.h"
 #include "sql_statistics.h"
 
+static str
+sql_set_stats(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, int 
type)
+{
+       mvc *m = NULL;
+       str sch = NULL, tbl = NULL, col = NULL, msg = MAL_SUCCEED;
+
+       if ((msg = getSQLContext(cntxt, mb, &m, NULL)) != NULL)
+               return msg;
+       if ((msg = checkSQLContext(cntxt)) != NULL)
+               return msg;
+
+       sch = *getArgReference_str(stk, pci, 1);
+       tbl = *getArgReference_str(stk, pci, 2);
+       col = *getArgReference_str(stk, pci, 3);
+
+       sql_schema *s = mvc_bind_schema(m, sch);
+       sql_table *t = s?mvc_bind_table(m, s, tbl):NULL;
+       sql_column *c = t?mvc_bind_column(m, t, col):NULL;
+       if (!c || !t || !s)
+               throw(SQL, "sql.set_stats", SQLSTATE(42000) "Cannot not find 
Column '%s.%s.%s'", sch, tbl, col);
+       sql_trans *tr = m->session->tr;
+    sqlstore *store = tr->store;
+       if (type > 0) {
+               if (getArgType(mb, pci, 4) != c->type.type->localtype)
+                       throw(SQL, "sql.set_stats", SQLSTATE(42000) "Wrong 
value type '%s'", BATatoms[getArgType(mb, pci, 4)].name);
+               ptr val = getArgReference(stk, pci, 4);
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to