JNSimba commented on code in PR #427: URL: https://github.com/apache/doris-flink-connector/pull/427#discussion_r1677570847
########## flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java: ########## @@ -507,14 +570,30 @@ public static String completeMilliseconds(String stringValue) { return stringValue; } - StringBuilder sb = new StringBuilder(stringValue); if (stringValue.length() == DATETIME_PATTERN.length()) { - sb.append("."); + stringValue += "."; } - while (sb.toString().length() < DATETIMEV2_PATTERN.length()) { - sb.append(0); + int s = DATETIMEV2_PATTERN.length() - stringValue.length(); + switch (s) { + case 1: + return stringValue + "0"; + case 2: + return stringValue + "00"; + case 3: + return stringValue + "000"; + case 4: + return stringValue + "0000"; + case 5: + return stringValue + "00000"; + case 6: + return stringValue + "000000"; + default: + return stringValue; } - return sb.toString(); + // while (sb.toString().length() < DATETIMEV2_PATTERN.length()) { + // sb.add("0"); + // } + // return sb.toString(); Review Comment: Add a comment explaining the reason for the change -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org