chengcongchina opened a new pull request, #4312: URL: https://github.com/apache/flink-cdc/pull/4312
This closes `https://issues.apache.org/jira/browse/FLINK-39209`. ### What is the purpose of the change This PR fixes an issue where sinking data to Doris using the Flink CDC Pipeline connector with `TIME` data type (e.g., `time(0)` from MySQL) would throw a serialization exception: `Java 8 date/time type java.time.LocalTime not supported by default`. Previously, the `DorisRowConverter` returned raw `LocalTime` objects for `TIME_WITHOUT_TIME_ZONE` types. Since the default Jackson `ObjectMapper` configuration in `DorisEventSerializer` does not support Java 8 time types without the `jackson-datatype-jsr310` module, this caused runtime failures. This PR introduces a dedicated `TIME_FORMATTER` (pattern: `HH:mm:ss.SSS`) to serialize `TIME` data into formatted strings before passing them to the Jackson serializer. ### Brief change log - Update `DorisEventSerializer` to include a `TIME_FORMATTER` constant with the pattern `HH:mm:ss.SSS`. - Update `DorisRowConverter` to format `TIME_WITHOUT_TIME_ZONE` data using `DorisEventSerializer.TIME_FORMATTER` instead of returning raw `LocalTime` objects. - Update `DorisEventSerializerTest` to include a new test case `testDataChangeEventWithFullDataType` covering `TIME(0)` and `TIME(3)` types. - Update `MySqlToDorisE2eITCase` and `data_types_test.sql` to include `TIME` columns in the end-to-end test scenario. ### Verifying this change This change is verified by the following tests: - `DorisEventSerializerTest#testDataChangeEventWithFullDataType`: Verifies that `TIME` data with different precisions are correctly serialized to the expected JSON string format without exceptions. - `MySqlToDorisE2eITCase`: Verifies the end-to-end data synchronization correctness for `TIME` type columns from MySQL to Doris. ### Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with @Public(Evolving): no - The serializers: yes - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no - The S3 file system connector: no ### Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
