pacman82 / arrow-odbc-py

Read Apache Arrow batches from ODBC data sources in Python
MIT License
60 stars 5 forks source link

Tinyint Mapping #94

Closed aersam closed 6 months ago

aersam commented 6 months ago

In MS SQL Server, tinyint is an unsigned int. It should be mapped to uint8 therefore, I think

https://learn.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver16

aersam commented 6 months ago

Other Systems like Spark have signed tinyint's, so maybe needs some differentiation

pacman82 commented 6 months ago

According to https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/sql-data-types?view=sql-server-ver16 tinyint can be both. Need to think about his.

pacman82 commented 6 months ago

Are you interested in the mapping for reading from the database or for writing to it?

aersam commented 6 months ago

Reading only for now

aersam commented 6 months ago

Well, is there metadata about the signed/unsigned thing?

Eg DuckDB supports utinyint and tinyint

pacman82 commented 6 months ago

arrow-odbc 7.0.0 is released. Distinguishing between signed and unsigned TinyInt.

Cheers!