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