aiwenmo commented on code in PR #3636:
URL: https://github.com/apache/flink-cdc/pull/3636#discussion_r1797532737


##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/schema/SchemaOperator.java:
##########
@@ -609,6 +643,34 @@ public Object getFieldOrNull(RecordData recordData) {
                                                     + "Currently only CHAR / 
VARCHAR can be accepted by a STRING column",
                                             originalField.getClass())));
                 }
+            } else if (destinationType.is(DataTypeRoot.TIME_WITHOUT_TIME_ZONE)
+                    && originalType.is(DataTypeRoot.TIME_WITHOUT_TIME_ZONE)) {
+                Integer value = (Integer) originalField;
+                int precisionDifference =
+                        ((TimeType) originalType).getPrecision()
+                                - ((TimeType) destinationType).getPrecision();
+                if (precisionDifference > 0) {
+                    return value / (int) Math.pow(10, precisionDifference);
+                } else if (precisionDifference < 0) {
+                    return value * (int) Math.pow(10, -precisionDifference);
+                } else {
+                    return value;
+                }

Review Comment:
   Currently, time supports only a precision of 0. We need to open another PR 
to implement a new feature that   custom precision for time, and then implement 
a new feature that support merging time columns when routing.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to