Closed MazrimT closed 3 years ago
fetch_mapper
is different from fetch_dict
. fetch_dict
adds only this line:
if self.fetch_dict:
row = dict(zip(self.col_names, row))
In theory, there are no possible type covernsions here.
Also, Exasol does not have real integer data type. All integers are converted and stored as DECIMAL: https://docs.exasol.com/sql_references/data_types/datatypealiases.htm
I suspect, you may have DECIMAL column which is larger than 18 digits. In this case Exasol sends results as string from server, because a lot of programming languages do not support JSON deserialisation to integers larger than 64 bits (8 bytes).
Without the fetch_mapper
being specified, PyEXASOL returns exactly what it got from server.
Solutions:
fetch_mapper = pyexasol.exasol_mapper
for connection options. All DECIMAL's with no fractional part will be returned as integers.int(...)
to cast specific value to integer.I would personally prefer the last solution. Performance will be much better.
When we use the fetch_dict=True flag then all integers turns into strings. Decimal/float/double seems to work as intended, but not integer, smallint, tinyint, bigint.
From what I can see in the mapper.py document there's nothing specified about any form of integers.