Skip to content

Conversation

@zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Jun 28, 2023

Proposed changes

cherry-pick from #21296

This pull request addresses the issue encountered when JDBC Catalog reads zero datetime values (0000-00-00 00:00:00) from non-nullable columns in MySQL. JDBC has difficulty handling such datetime format, which leads to read errors.

The proposed solution introduces the parameter zeroDateTimeBehavior=convertToNull in the jdbc_url. In this manner, when JDBC encounters 0000-00-00 00:00:00, it will convert these zero datetime values to null. Consequently, Doris will treat the DateTime column as a nullable type, allowing the read operation to proceed successfully. This change ensures data integrity and enhances read reliability when working with MySQL data sources.

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@morningman morningman merged commit a0294ba into apache:branch-1.2-lts Jun 28, 2023
mongo360 pushed a commit to mongo360/doris that referenced this pull request Jul 12, 2023
@zy-kkk zy-kkk deleted the fix_jdbc_null_2 branch July 28, 2023 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants