|
24 | 24 | import org.apache.flink.cdc.common.data.DateData; |
25 | 25 | import org.apache.flink.cdc.common.data.DecimalData; |
26 | 26 | import org.apache.flink.cdc.common.data.LocalZonedTimestampData; |
| 27 | +import org.apache.flink.cdc.common.data.ZonedTimestampData; |
27 | 28 | import org.apache.flink.cdc.common.data.RecordData; |
28 | 29 | import org.apache.flink.cdc.common.data.TimeData; |
29 | 30 | import org.apache.flink.cdc.common.data.TimestampData; |
|
68 | 69 | import java.time.Instant; |
69 | 70 | import java.time.LocalDateTime; |
70 | 71 | import java.time.LocalTime; |
| 72 | +import java.time.OffsetDateTime; |
71 | 73 | import java.time.ZoneId; |
72 | 74 | import java.util.ArrayList; |
73 | 75 | import java.util.HashMap; |
@@ -298,7 +300,8 @@ public void testTimeTypesWithTemporalModeAdaptive() throws Exception { |
298 | 300 | TimestampData.fromLocalDateTime( |
299 | 301 | LocalDateTime.parse("2020-07-17T18:00:22.123456")), |
300 | 302 | TimestampData.fromLocalDateTime(LocalDateTime.parse("2020-07-17T18:00:22")), |
301 | | - LocalZonedTimestampData.fromInstant(toInstant("2020-07-17 18:00:22")), |
| 303 | + ZonedTimestampData.fromOffsetDateTime( |
| 304 | + OffsetDateTime.parse("2020-07-17T10:00:22Z")), |
302 | 305 | }; |
303 | 306 |
|
304 | 307 | List<Event> snapshotResults = fetchResultsAndCreateTableEvent(events, 1).f0; |
@@ -354,7 +357,8 @@ public void testTimeTypesWithTemporalModeMicroSeconds() throws Exception { |
354 | 357 | TimestampData.fromLocalDateTime( |
355 | 358 | LocalDateTime.parse("2020-07-17T18:00:22.123456")), |
356 | 359 | TimestampData.fromLocalDateTime(LocalDateTime.parse("2020-07-17T18:00:22")), |
357 | | - LocalZonedTimestampData.fromInstant(toInstant("2020-07-17 18:00:22")), |
| 360 | + ZonedTimestampData.fromOffsetDateTime( |
| 361 | + OffsetDateTime.parse("2020-07-17T10:00:22Z")), |
358 | 362 | }; |
359 | 363 |
|
360 | 364 | List<Event> snapshotResults = fetchResultsAndCreateTableEvent(events, 1).f0; |
@@ -409,7 +413,8 @@ public void testTimeTypesWithTemporalModeConnect() throws Exception { |
409 | 413 | TimestampData.fromLocalDateTime(LocalDateTime.parse("2020-07-17T18:00:22.123")), |
410 | 414 | TimestampData.fromLocalDateTime(LocalDateTime.parse("2020-07-17T18:00:22.123")), |
411 | 415 | TimestampData.fromLocalDateTime(LocalDateTime.parse("2020-07-17T18:00:22")), |
412 | | - LocalZonedTimestampData.fromInstant(toInstant("2020-07-17 18:00:22")), |
| 416 | + ZonedTimestampData.fromOffsetDateTime( |
| 417 | + OffsetDateTime.parse("2020-07-17T10:00:22Z")), |
413 | 418 | }; |
414 | 419 |
|
415 | 420 | List<Event> snapshotResults = fetchResultsAndCreateTableEvent(events, 1).f0; |
@@ -1042,7 +1047,7 @@ private Instant toInstant(String ts) { |
1042 | 1047 | DataTypes.TIMESTAMP(3), |
1043 | 1048 | DataTypes.TIMESTAMP(6), |
1044 | 1049 | DataTypes.TIMESTAMP(), |
1045 | | - DataTypes.TIMESTAMP_LTZ(0)); |
| 1050 | + DataTypes.TIMESTAMP_TZ(0)); |
1046 | 1051 |
|
1047 | 1052 | private static final RowType HSTORE_TYPES_WITH_ADAPTIVE = |
1048 | 1053 | RowType.of(DataTypes.INT(), DataTypes.MAP(DataTypes.STRING(), DataTypes.STRING())); |
|
0 commit comments