You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/05 11:33:27 UTC

[GitHub] [flink] matriv commented on a diff in pull request #19302: [FLINK-26810][connectors/elasticsearch] Use local timezone for TIMESTAMP_WITH_LOCAL_TIMEZONE fields in dynamic index

matriv commented on code in PR #19302:
URL: https://github.com/apache/flink/pull/19302#discussion_r842679900


##########
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/IndexGeneratorTest.java:
##########
@@ -86,6 +89,7 @@
                                     LocalDateTime.of(2020, 3, 18, 12, 12, 14, 1000)),
                             (int) LocalDate.of(2020, 3, 18).toEpochDay(),
                             (int) (LocalTime.of(12, 13, 14, 2000).toNanoOfDay() / 1_000_000L),
+                            TimestampData.fromTimestamp(Timestamp.valueOf("2020-03-18 12:12:14")),

Review Comment:
   You would need to use a custom timezone to test correctly the TIMESTAMP_WITH_LOCAL_TIME_ZONE:
   ```
   TimestampData.fromInstant(
                   LocalDateTime.of(years, months, days, hours, minutes, seconds, nanos)
                           .atZone(<MyCustomTestZone>) // i.e. ZoneId.of("Asia/Shanghai")
                           .toInstant());
   ```



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

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