
Hi, please find here my earlier explanation why MonetDB chooses the largest available data type for aggregations: https://www.monetdb.org/pipermail/users-list/2018-January/010102.html The largest integer type available in MonetDB depends the what the compiler supports and what is chosen at compile time (see configure options). Recent versions of GNU gcc and Intel icc support (up to) 128-bit on most "Unix-like" OSs, while (AFAIK) Microsoft Visual Studio does not support 128-bit integers on Windows. For an overview of SQL types supported by MonetDB see also: https://www.monetdb.org/Documentation/Manuals/SQLreference/BuiltinTypes
From your example, I conclude that you compiled your MonetDB with 128-bit support (the default, if the compiler supports it), while for your binary version you did not install the 128-bit integer (aka. "hugeint") RPMs (MonetDB5-server-hugeint and MonetDB-SQL-server5-hugeint).
To achieve the same behavior with both your binary-installed and your self-compiled version of MonetDB, you can either install the above mentioned hugeint RPMs to enable 128-bit integers ("hugeint") or configure the sources with --disable-int128 and re-compile from scratch to disable 128-bit integers ("hugeint"). In either case, you'd need to re-create your databases. Best, Stefan ----- On Jan 17, 2018, at 5:44 PM, Sreejith Sharma Sreejith.Sharma@harman.com wrote:
All,
Here is a quick question. I have compiled “MonetDB v11.27.9 (Jul2017-SP2)” version of source code and while running below sample SQL am finding an issue. Could anyone help me to trace issue? Is this due to the compiler version?
Issue Details:
While using SUM() or any function without an alias the header datatype returned is showing as HUGEINT for base INTEGER column, where as it should have been BIGINT. This is causing a failure in my BI application as it’s having issues in identifying HUGEINT.
Below are the details.
Source Code Version : MonetDB v11.27.9 (Jul2017-SP2)
Linux OS Version : CentOS release 6.3 (Final)
C Compile Version : gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
Also, I see below note in MonetDB documentation. Which version of GCC should be appropriate for compilation with __128 bit integer.
Note : HUGEINT is only available since the Jul2015 release and on platforms with a C-compiler that supports the __int128 or __int128_t data type (e.g., recent gcc, clang, & icc on Linux or MacOS X)
Sample Table DDL :
CREATE TABLE INT_VALID (COL_INT INTEGER, COL_BIGINT BIGINT, COL_HUGEINT HUGEINT, COL_DOUBLE DOUBLE, COL_NUMERIC NUMERIC(10));
Compiled Version
sql>SELECT SUM(col_int) FROM INT_VALID;
mapi_query_part:36:SELECT SUM(col_int) FROM INT_VALID;
fetch next block: start at:10093
got next block: length:105
text:&1 4 1 1 1 2452
% DM_POS_TSV_MRT_P6A.L4 # table_name
% L3 # name
% hugeint # type
% 5 # length
[ 11110 ]
Binary Version
sql>SELECT SUM(col_int) FROM INT_VALID;
mapi_query_part:36:SELECT SUM(col_int) FROM INT_VALID;
fetch next block: start at:1168
got next block: length:105
text:&1 4 1 1 1 13998
% DM_POS_TSV_MRT_P6A.L4 # table_name
% L3 # name
% bigint # type
% 5 # length
[ 11110 ]
+---------+------------+--------------------------+-------------+
| col_int | col_bigint | col_double | col_numeric |
+=========+============+==========================+=============+
| 1111 | 1234567 | 1234.44 | 1111 |
| 2222 | 2345678 | 34355.66 | 2222 |
| 3333 | 3456789 | 66423.66 | 3333 |
| 4444 | 45678912 | 8765.66 | 4444 |
+---------+------------+--------------------------+-------------+
Regards,
Sreejith
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |