Hi!
We were faced with a problem when we were using MySql Source Connector.
In our source, we have a column with type tinyint(1), but it doesn’t mean that values are limited to 0/1. Those values can be in the range of 0…9, but Airbyte’s MySql Connector casts them to boolean (MySQL | Airbyte Documentation )
And so we are losing real values(
About MySQL type tinyint: MySQL :: MySQL 8.0 Reference Manual :: 11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
It means that
Minimum and Maximum Value Signed = -128…127
or
Minimum and Maximum Value Unsigned = 0…255
And the value in brackets only means the display width.
Maybe there are some solutions to such problems?
Hello please check this Github Discussion: https://github.com/airbytehq/airbyte/issues/10976
From MySQL documentation: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html
BOOL, BOOLEANThese types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true.
leeco
August 21, 2022, 9:23pm
3
Hi @coca-alex @marcosmarxm
I had the same problem
opened 11:46AM - 09 Mar 22 UTC
closed 06:00PM - 05 Jul 22 UTC
type/bug
community
team/databases
autoteam
## Environment
- **Airbyte version**: 0.35.26-alpha
- **OS Version / Instance… **: AWS EC2
- **Deployment**: Docker
- **Source Connector and version**: MySql 0.5.1
- **Destination Connector and version**: Snowflake 0.4.8
- **Severity**: Medium / High
- **Step where error happened**: Sync job
## Current Behavior
I have a table in MySql with a column of tinyint containing values 0,1,2, or 3,
but in the destination the values get converted to Boolean. 0 becomes false and 1,2, or 3 becomes true.
This is the case for both raw tables as well as basic normalization tables
## Expected Behavior
I expect values 0,1,2, or 3 being reflected in snowflake rather than boolean.
I might understand if distinct values were 0 or 1 maybe, but if there are ranges of values, this conversion should not happen.
@leeco and @coca-alex you can change the connector to work without using the default behavior of Airbyte. Today Airbyte handle this as described in MySQL documentation, maybe in the future can be changed to another way.