dramaticlly commented on code in PR #16699:
URL: https://github.com/apache/iceberg/pull/16699#discussion_r3374871199
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteManifestsAction.java:
##########
@@ -196,6 +196,144 @@ public void testRewriteManifestsPreservesOptionalFields()
throws IOException {
}
}
+ @TestTemplate
+ public void testRewriteV3ManifestsPreservesFirstRowId() {
+ assumeThat(formatVersion).isGreaterThanOrEqualTo(3);
+
+ PartitionSpec spec = PartitionSpec.unpartitioned();
+ Map<String, String> options = Maps.newHashMap();
+ options.put(TableProperties.FORMAT_VERSION, String.valueOf(formatVersion));
+ Table table = TABLES.create(SCHEMA, spec, options, tableLocation);
+
+ writeRecords(Lists.newArrayList(new ThreeColumnRecord(1, null, "AAAA")));
+ writeRecords(Lists.newArrayList(new ThreeColumnRecord(2, "CCCC", "CCCC")));
+ table.refresh();
+
+ assertThat(table.currentSnapshot().dataManifests(table.io())).hasSize(2);
+
+ List<Row> rowsBefore =
+ spark
+ .read()
+ .format("iceberg")
+ .load(tableLocation)
+ .selectExpr("_row_id", "_last_updated_sequence_number", "*")
+ .orderBy("_row_id")
+ .collectAsList();
Review Comment:
Nit: I saw this used a few times to collect the rows with row lineage
metadata columns, looks like we might be able to reuse if
https://github.com/apache/iceberg/blob/48727c9072a017f582045c429cfe861bae0c0537/spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java#L2179-L2191
is moved to the `TestBase` shared across SparkTest.
--
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]