yuxiqian commented on code in PR #4060:
URL: https://github.com/apache/flink-cdc/pull/4060#discussion_r2290432100
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-debezium/src/main/java/org/apache/flink/cdc/debezium/event/DebeziumEventDeserializationSchema.java:
##########
@@ -284,22 +286,22 @@ protected Object convertToFloat(Object dbzObj, Schema
schema) {
}
protected Object convertToDate(Object dbzObj, Schema schema) {
- return (int) TemporalConversions.toLocalDate(dbzObj).toEpochDay();
+ return DateData.fromLocalDate(TemporalConversions.toLocalDate(dbzObj));
}
protected Object convertToTime(Object dbzObj, Schema schema) {
if (dbzObj instanceof Long) {
switch (schema.name()) {
case MicroTime.SCHEMA_NAME:
- return (int) ((long) dbzObj / 1000);
+ return TimeData.fromNanoOfDay((long) dbzObj * 1000);
Review Comment:
1 second = 1,000 milliSeconds = 1,000,000 microSeconds = 1,000,000,000
nanoSeconds.
So we have to use `fromMillisOfDay(x / 1000)`, which isn't better than
`fromNanoOfDay(x * 1000)`
--
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]