diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorSmokeTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorSmokeTest.java index b499a7309f15..df10f40055a1 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorSmokeTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorSmokeTest.java @@ -36,6 +36,7 @@ import org.junit.jupiter.api.Timeout; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Optional; import java.util.concurrent.CyclicBarrier; @@ -53,7 +54,7 @@ import static io.trino.testing.TestingConnectorSession.SESSION; import static io.trino.testing.TestingNames.randomNameSuffix; import static java.lang.String.format; -import static java.time.format.DateTimeFormatter.ISO_INSTANT; +import static java.time.ZoneOffset.UTC; import static java.util.Objects.requireNonNull; import static java.util.concurrent.Executors.newFixedThreadPool; import static java.util.concurrent.TimeUnit.SECONDS; @@ -727,6 +728,8 @@ public void testPartitionFilterRequired() @Test public void testTableChangesFunction() { + DateTimeFormatter instantMillisFormatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ss.SSSVV").withZone(UTC); + try (TestTable table = new TestTable( getQueryRunner()::execute, "test_table_changes_function_", @@ -734,7 +737,7 @@ public void testTableChangesFunction() long initialSnapshot = getMostRecentSnapshotId(table.getName()); assertUpdate("INSERT INTO " + table.getName() + " SELECT nationkey, name FROM nation", 25); long snapshotAfterInsert = getMostRecentSnapshotId(table.getName()); - String snapshotAfterInsertTime = getSnapshotTime(table.getName(), snapshotAfterInsert).format(ISO_INSTANT); + String snapshotAfterInsertTime = getSnapshotTime(table.getName(), snapshotAfterInsert).format(instantMillisFormatter); assertQuery( "SELECT nationkey, name, _change_type, _change_version_id, to_iso8601(_change_timestamp), _change_ordinal " + @@ -743,7 +746,7 @@ public void testTableChangesFunction() assertUpdate("DELETE FROM " + table.getName(), 25); long snapshotAfterDelete = getMostRecentSnapshotId(table.getName()); - String snapshotAfterDeleteTime = getSnapshotTime(table.getName(), snapshotAfterDelete).format(ISO_INSTANT); + String snapshotAfterDeleteTime = getSnapshotTime(table.getName(), snapshotAfterDelete).format(instantMillisFormatter); assertQuery( "SELECT nationkey, name, _change_type, _change_version_id, to_iso8601(_change_timestamp), _change_ordinal " +