dbac commented on code in PR #3866: URL: https://github.com/apache/paimon/pull/3866#discussion_r1704863702
########## paimon-core/src/test/java/org/apache/paimon/iceberg/IcebergCompatibilityTest.java: ########## @@ -271,6 +274,101 @@ public void testAppendOnlyTableWithAllTypes() throws Exception { r -> ""); } + @Test + public void testPartitionedPrimaryKeyTable_Timestamp() throws Exception { + RowType rowType = + RowType.of( + new DataType[] { + DataTypes.TIMESTAMP(), + DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(), + DataTypes.STRING(), + DataTypes.INT(), + DataTypes.BIGINT() + }, + new String[] {"pt1", "pt2", "k", "v1", "v2"}); + + BiFunction<Timestamp, Timestamp, BinaryRow> binaryRow = + (pt1, pt2) -> { + BinaryRow b = new BinaryRow(2); + BinaryRowWriter writer = new BinaryRowWriter(b); + writer.writeTimestamp(0, pt1, 6); + writer.writeTimestamp(1, pt2, 6); + writer.complete(); + return b; + }; + + int numRecords = 1000; + ThreadLocalRandom random = ThreadLocalRandom.current(); + List<TestRecord> testRecords = new ArrayList<>(); + for (int i = 0; i < numRecords; i++) { + Timestamp pt1 = Timestamp.fromEpochMillis(random.nextInt(0, 99999)); + Timestamp pt2 = + DateTimeUtils.timestampToTimestampWithLocalZone(pt1, DateTimeUtils.UTC_ZONE); + String k = String.valueOf(random.nextInt(0, 100)); + int v1 = random.nextInt(); + long v2 = random.nextLong(); + testRecords.add( + new TestRecord( + binaryRow.apply(pt1, pt2), + String.format("%s|%s|%s", pt1, pt2, k), + String.format("%d|%d", v1, v2), + GenericRow.of(pt1, pt2, BinaryString.fromString(k), v1, v2))); + } + + runCompatibilityTestForTimeAndTimeStamp( + rowType, + Arrays.asList("pt1", "pt2"), + Arrays.asList("pt1", "pt2", "k"), + testRecords); + } + + @Test + public void testPartitionedPrimaryKeyTable_Time() throws Exception { Review Comment: thanks -- 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-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org