-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source MySQL: Connector provides wrong values for some datatypes #3932
Comments
I'm also experiencing this issue. Some Boolean can be expressed as tinyint(1) but not all tinyint(1) are booleans. I DO note, however, that where a tinyint(1) column has non-'1' values (e.g. '2' or '13'), the normalised field becomes But, let's say a table was synced with a tinyint(1) with only '1' and '0', but '2' or '3' are also possible values. Then airbyte would write it as a boolean field. If, say, an incremental sync method was used, it would probably run into issues when trying to added the '3' value into the destination boolean field later. (untested) I would suggest staying true to the original data type e.g. TINYINT => SMALLINT, etc. |
Hi @tuanchris, |
Hi @DoNotPanicUA, I think this might be a problem with how debezium treats float values. I faced a similar issue before with debezium & kafka as outlined here. Also since the raw data replicated to BQ is in byte already, I doubt that this is a destination problem. |
* move logic from static JdbcUtils to JdbcSourceOperations * format * Add methods for all types in order to have possibility rewrite them and use common type mapping. * Make BigQuery in line impl with JDBC changes * fix binary type * add database creations methods with sourceOperations input * add MySqlSourceOperations * fix processing * Fix CDC processing * format * add some tests for double and float * incr version * #3931 #3932 added zero-date converting to null param "zeroDateTimeBehavior=convertToNull" * remove old tests covered by data type tests + incr ver * Update airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLDestination.java Co-authored-by: Sherif A. Nada <[email protected]> * Update docs/integrations/sources/mysql.md Co-authored-by: Sherif A. Nada <[email protected]> * add back comments to the data type mapping * incr config version Co-authored-by: Oleksandr Sheheda <[email protected]> Co-authored-by: Sherif A. Nada <[email protected]>
* move logic from static JdbcUtils to JdbcSourceOperations * format * Add methods for all types in order to have possibility rewrite them and use common type mapping. * Make BigQuery in line impl with JDBC changes * fix binary type * add database creations methods with sourceOperations input * add MySqlSourceOperations * fix processing * Fix CDC processing * format * add some tests for double and float * incr version * airbytehq#3931 airbytehq#3932 added zero-date converting to null param "zeroDateTimeBehavior=convertToNull" * remove old tests covered by data type tests + incr ver * Update airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLDestination.java Co-authored-by: Sherif A. Nada <[email protected]> * Update docs/integrations/sources/mysql.md Co-authored-by: Sherif A. Nada <[email protected]> * add back comments to the data type mapping * incr config version Co-authored-by: Oleksandr Sheheda <[email protected]> Co-authored-by: Sherif A. Nada <[email protected]>
Found by comprehensive tests #3562
Requires #5704
Expected Behavior
A connector should transform source data into an Airbyte datatype without value/meaning losses.
Current Behavior
General source implementation:
bit
. Returns valuestrue
,false
instead of1
,0
varbinary
,blob
. Binary text type transforms into binary value instead of text.mediumtext
,longtext
. Long text replaces by empty value. For example, text with length 16777214 will be empty after transformation.bool
/boolean
. MySQL transformation logic from number to boolean treats only1
astrue
. All other values arefalse
. The connector treats all values >0
astrue
.CDC source implementation:
bit
. Returns valuestrue
,false
instead of1
,0
varchar
. Values with different carchecter sets become unreadable after transformation. For example,тест
->тест
or utf16 symbol�
->�
varbinary
,blob
. Binary text type transforms into binary value instead of text.mediumtext
,longtext
. Long text replaces by empty value. For example, text with length 16777214 will be empty after transformation.bool
/boolean
. Returns number values instead of boolean.Steps to Reproduce
Short way:
MySqlSourceComprehensiveTest.java
and uncomment test values at lines:197
,273
,282
,291
,339
. Or go toCdcMySqlSourceComprehensiveTest.java
and uncomment test values at lines:238
,272
,282
,301
,310
,319
,36\
Long way:
Severity of the bug for you
High
Airbyte Version
0.24.7-alpha
Connector Version
0.3.4
The text was updated successfully, but these errors were encountered: