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


##########
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/IndexGeneratorTest.java:
##########
@@ -101,9 +105,28 @@
                                     LocalDateTime.of(2020, 3, 19, 12, 22, 14, 
1000)),
                             (int) LocalDate.of(2020, 3, 19).toEpochDay(),
                             (int) (LocalTime.of(12, 13, 14, 
2000).toNanoOfDay() / 1_000_000L),
+                            
TimestampData.fromTimestamp(Timestamp.valueOf("2020-03-19 12:22:14")),
                             "test2",
                             false));
 
+    @Test
+    public void testDynamicIndexFromTimestampTz() {
+        IndexGenerator indexGenerator =
+                IndexGeneratorFactory.createIndexGenerator(
+                        "{local_timestamp|yyyy_MM_dd_HH-ss}_index", 
fieldNames, dataTypes);
+        indexGenerator.open();
+
+        if (ZoneId.systemDefault().equals(ZoneId.of("UTC"))) {

Review Comment:
   This if/else doesn't make sense for the test, you need to provide custom 
timezones for the data.



##########
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/table/IndexGeneratorFactoryTest.java:
##########
@@ -197,8 +198,17 @@ public void 
testDynamicIndexDefaultFormatTimestampWithLocalTimeZone() {
         IndexGenerator indexGenerator =
                 
IndexGeneratorFactory.createIndexGenerator("my-index-{local_timestamp|}", 
schema);
         indexGenerator.open();
-        Assert.assertEquals("my-index-2020_03_18_12_12_14Z", 
indexGenerator.generate(rows.get(0)));
-        Assert.assertEquals("my-index-2020_03_19_12_12_14Z", 
indexGenerator.generate(rows.get(1)));
+        if (ZoneId.systemDefault().equals(ZoneId.of("UTC"))) {

Review Comment:
   same here.



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