You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/21 07:38:49 UTC

[GitHub] [inlong] thesumery commented on a diff in pull request #6257: [INLONG-6250][Sort] Return ZonedTimestamp when mysql data schema is timestamp or dataTime

thesumery commented on code in PR #6257:
URL: https://github.com/apache/inlong/pull/6257#discussion_r1001467594


##########
inlong-sort/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/cdc/debezium/table/RowDataDebeziumDeserializeSchema.java:
##########
@@ -635,14 +634,10 @@ private Object getTimeValue(Object fieldValue, String schemaName) {
                 fieldValue = dateFormatter.format(LocalDate.ofEpochDay((Integer) fieldValue));
                 break;
             case ZonedTimestamp.SCHEMA_NAME:
-                ZonedDateTime zonedDateTime = ZonedDateTime.parse((CharSequence) fieldValue);
-                fieldValue = timestampFormatter.format(zonedDateTime
-                        .withZoneSameInstant(serverTimeZone).toLocalDateTime());
+                // by default the field value is zoned timestamp, no need to convert
                 break;
             case Timestamp.SCHEMA_NAME:
-                Instant instantTime = Instant.ofEpochMilli((Long) fieldValue);
-                fieldValue = timestampFormatter.format(LocalDateTime.ofInstant(instantTime,
-                        serverTimeZone));
+                fieldValue = Instant.ofEpochMilli((Long) fieldValue).toString();

Review Comment:
   think about timezone problem.



-- 
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-unsubscribe@inlong.apache.org

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