-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Source-MySQL: Update CDC conversion logic to handle null values for non-null columns by converting them to the default epoch value #67623
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
base: master
Are you sure you want to change the base?
Conversation
…on-null columns by converting them to the default epoch value
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
| `geometry` | base64 binary string | | | ||
| MySQL Type | Resulting Type | Notes | | ||
| :---------------------------------------- | :--------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `bit(1)` | boolean | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'boolean'?
| :---------------------------------------- | :--------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `bit(1)` | boolean | | | ||
| `bit(>1)` | base64 binary string | | | ||
| `boolean` | boolean | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'boolean'?
| `bit(1)` | boolean | | | ||
| `bit(>1)` | base64 binary string | | | ||
| `boolean` | boolean | | | ||
| `tinyint(1)` | boolean | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'boolean'?
| `decimal` | number | | | ||
| `binary` | string | | | ||
| `blob` | string | | | ||
| `date` | string | ISO-8601 datetime string. Zero-date values will be converted to Unix epoch (`1970-01-01`) when using CDC mode to prevent sync failures. In non-CDC syncs, zero-dates will be NULL. If using a zero-date column as a cursor or if the column is NOT NULL, convert to EPOCH. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'datetime'?
| `decimal` | number | | | ||
| `binary` | string | | | ||
| `blob` | string | | | ||
| `date` | string | ISO-8601 datetime string. Zero-date values will be converted to Unix epoch (`1970-01-01`) when using CDC mode to prevent sync failures. In non-CDC syncs, zero-dates will be NULL. If using a zero-date column as a cursor or if the column is NOT NULL, convert to EPOCH. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google.Will] Avoid using 'will'.
| `datetime`, `timestamp` | string | ISO-8601 datetime string. Zero-date values will be converted to Unix epoch (`1970-01-01`) when using CDC mode to prevent sync failures. In non-CDC syncs, zero-dates will be NULL. If using a zero-date column as a cursor or if the column is NOT NULL, convert to EPOCH. | | ||
| `time` | string | ISO 8601 time string. Values are in range between 00:00:00 and 23:59:59. | | ||
| `year` | year string | [Doc](https://dev.mysql.com/doc/refman/8.0/en/year.html) | | ||
| `char`, `varchar` with non-binary charset | string | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'charset'?
| `text` | string | | | ||
| `mediumtext` | string | | | ||
| `longtext` | string | | | ||
| `json` | serialized json string | E.g. `{"a": 10, "b": 15}` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'json'?
| `text` | string | | | ||
| `mediumtext` | string | | | ||
| `longtext` | string | | | ||
| `json` | serialized json string | E.g. `{"a": 10, "b": 15}` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Google.Latin] Use 'for example' instead of 'E.g.'.
| `longtext` | string | | | ||
| `json` | serialized json string | E.g. `{"a": 10, "b": 15}` | | ||
| `enum` | string | | | ||
| `set` | string | E.g. `blue,green,yellow` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Google.Latin] Use 'for example' instead of 'E.g.'.
|:------------|:-----------|:-----------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| 3.50.9 | 2025-10-06 | [67151](https://github.com/airbytehq/airbyte/pull/66515) | Fix CDC decorating fields encoding to Protobuf | | ||
| 3.50.10 | 2025-10-10 | []() | Fix CDC sync failures caused by zero-dates in non-nullable columns. | | ||
| 3.50.9 | 2025-10-06 | [67151](https://github.com/airbytehq/airbyte/pull/67151) | Fix CDC decorating fields encoding to Protobuf | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'Protobuf'?
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit df4e390. |
What
Fixes 9165.
Zero-dates in MySQL will be returned by the JDBC driver as null values, which we populate and send to Debezium. However, if the column is NOT NULL, we get an Invalid value: null used for required field error from Debezium that shuts down the connection.
How
MySqlSourceCdcTemporalConverter.kt
so that NULL values are no longer sent to Debezium. When we receive a null value from JDBC (indicating a zero-date), we convert it to the EPOCH default date (i.e.1970-01-01T00:00:00.000000
).The only exception is TIME, since MySQL
does
allow zero-dates for this type. If we receive a NULL value for TIME, it indicates the value is invalid/corrupt (see https://dev.mysql.com/doc/refman/8.0/en/time.html)Review guide
User Impact
1970-01-01T00:00:00.000000
(or equivalent for DATE) instead of NULL in CDC mode.Can this PR be safely reverted and rolled back?