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:31:07 UTC

[GitHub] [inlong] EMsnap opened a new pull request, #6257: [INLONG-6250][Sort] Return ZonedTimestamp when mysql data schema is timestamp or dataTime

EMsnap opened a new pull request, #6257:
URL: https://github.com/apache/inlong/pull/6257

   - Fixes #6250 
   
   ### Motivation
   
   [INLONG-6250][Sort] Return ZonedTimestamp when mysql data schema is timestamp or dataTime
   
   ### Modifications
   
   [INLONG-6250][Sort] Return ZonedTimestamp when mysql data schema is timestamp or dataTime
   
   ### Verifying this change
   
   run AllmigrateTest


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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [inlong] EMsnap merged pull request #6257: [INLONG-6250][Sort] Return ZonedTimestamp when mysql data schema is timestamp or dataTime

Posted by GitBox <gi...@apache.org>.
EMsnap merged PR #6257:
URL: https://github.com/apache/inlong/pull/6257


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


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

Posted by GitBox <gi...@apache.org>.
thesumery commented on code in PR #6257:
URL: https://github.com/apache/inlong/pull/6257#discussion_r1001469139


##########
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:
   Instance.ofEpochMilli default think about UTC time zone, so it is useless for parameter `serverTimeZone`;



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