szehon-ho commented on code in PR #4637:
URL: https://github.com/apache/iceberg/pull/4637#discussion_r865163707
##########
core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java:
##########
@@ -550,6 +550,119 @@ public void testDeleteFilesTableSelection() throws
IOException {
Assert.assertEquals(expected, scan.schema().asStruct());
}
+ @Test
+ public void testPartitionSpecEvolutionAdditive() {
+ preparePartitionedTable();
+
+ // Change spec and add two data files
+ table.updateSpec()
+ .addField("id")
+ .commit();
+ PartitionSpec newSpec = table.spec();
+
+ // Add two data files with new spec
+ PartitionKey data10Key = new PartitionKey(newSpec, table.schema());
+ data10Key.set(0, 0); // data=0
+ data10Key.set(1, 10); // id=10
+ DataFile data10 = DataFiles.builder(newSpec)
+ .withPath("/path/to/data-10.parquet")
+ .withRecordCount(10)
+ .withFileSizeInBytes(10)
+ .withPartition(data10Key)
+ .build();
+ PartitionKey data11Key = new PartitionKey(newSpec, table.schema());
+ data11Key.set(0, 1); // data=0
+ data10Key.set(1, 11); // id=11
+ DataFile data11 = DataFiles.builder(newSpec)
+ .withPath("/path/to/data-11.parquet")
+ .withRecordCount(10)
+ .withFileSizeInBytes(10)
+ .withPartition(data11Key)
+ .build();
+
+ table.newFastAppend().appendFile(data10).commit();
+ table.newFastAppend().appendFile(data11).commit();
Review Comment:
Yea , it messes up the test a little bit as it combines into one manifest
(as the test is a bit low level and depends on how many manifestReadTask get
spawned)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]