The microseconds default value of '0000-00-00 00:00:00.000000' for MySQL TIMESTAMP fields is not supported in downstream systems.#4251
Open
yunhaoww wants to merge 4 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the existing MySQL “zero timestamp” default-value compatibility handling to also cover microsecond TIMESTAMP defaults (0000-00-00 00:00:00.000000) that are rejected by downstream systems/connectors.
Changes:
- Update invalid timestamp default conversion logic to treat values starting with
0000-00-00 00:00:00as invalid (covers microsecond variants). - Add integration/unit tests for Doris, StarRocks, and Paimon connectors to validate microsecond-precision zero timestamp defaults are handled during schema application.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/test/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksMetadataApplierITCase.java | Adds IT coverage for TIMESTAMP(6)/TIMESTAMP_LTZ(6) default 0000-00-00 00:00:00.000000 in create-table and add-column flows. |
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksUtils.java | Broadens invalid default detection from equality to prefix-match to include microsecond variants. |
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/test/java/org/apache/flink/cdc/connectors/paimon/sink/PaimonMetadataApplierTest.java | Adds test coverage for add-column with microsecond zero timestamp defaults. |
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/main/java/org/apache/flink/cdc/connectors/paimon/sink/SchemaChangeProvider.java | Broadens invalid default detection from equality to prefix-match to include microsecond variants. |
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-doris/src/test/java/org/apache/flink/cdc/connectors/doris/sink/DorisMetadataApplierITCase.java | Adds IT coverage for TIMESTAMP(6)/TIMESTAMP_LTZ(6) microsecond zero timestamp defaults in create-table and add-column flows (batch + streaming). |
| flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-doris/src/main/java/org/apache/flink/cdc/connectors/doris/sink/DorisMetadataApplier.java | Broadens invalid default detection from equality to prefix-match to include microsecond variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
an append for #4096