Skip to content

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
yunhaoww:fixMicroSecondsDefaultValue
Open

The microseconds default value of '0000-00-00 00:00:00.000000' for MySQL TIMESTAMP fields is not supported in downstream systems.#4251
yunhaoww wants to merge 4 commits intoapache:masterfrom
yunhaoww:fixMicroSecondsDefaultValue

Conversation

@yunhaoww
Copy link

an append for #4096

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:00 as 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.

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