azexcy commented on code in PR #26380:
URL: https://github.com/apache/shardingsphere/pull/26380#discussion_r1231766938


##########
kernel/data-pipeline/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/util/ColumnValueConvertUtils.java:
##########
@@ -108,9 +103,7 @@ public static Message convertToProtobufMessage(final Object 
object) {
         }
         if (object instanceof Time) {
             Time time = (Time) object;
-            long millis = (int) (time.getTime() % MILLISECONDS_PER_SECOND);
-            int nanosOfSecond = (int) (millis * NANOSECONDS_PER_MILLISECOND);
-            LocalTime localTime = LocalTime.of(time.getHours(), 
time.getMinutes(), time.getSeconds(), nanosOfSecond);
+            LocalTime localTime = LocalTime.of(time.getHours(), 
time.getMinutes(), time.getSeconds(), new Timestamp(time.getTime()).getNanos());

Review Comment:
   `new Timestamp()` will fix nano is negative value
   <img width="726" alt="image" 
src="https://github.com/apache/shardingsphere/assets/101622833/bd559fe5-3101-4fa3-bdc4-3deeef49e317";>
   



-- 
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]

Reply via email to