matriv commented on code in PR #19302:
URL: https://github.com/apache/flink/pull/19302#discussion_r842719538
##########
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:
As discussed, it would be safe, to test the "UTC" as system's default zone,
with an `Assume.true(ZoneId.systemDefault().equals(ZoneId.of("UTC"))`, because
the tests might run in a system where the zone is something else (i.e. "GMT")
but with the same offset, so the `else` part as it is would fail.
--
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]