smaheshwar-pltr commented on code in PR #18489:
URL: https://github.com/apache/iceberg/pull/18489#discussion_r4644344664
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/sql/TestTableEncryption.java:
##########
@@ -185,6 +185,29 @@ void transactionCanReadAfterTableRefresh() {
assertThat(currentDataFiles(table)).hasSize(dataFiles.size() + 1);
}
+ @TestTemplate
+ void transactionCanReadAfterMetadataCommits() {
+ validationCatalog.initialize(catalogName, catalogConfig);
+ Table table = validationCatalog.loadTable(tableIdent);
+ List<DataFile> dataFiles = currentDataFiles(table);
+ DataFile file = dataFiles.get(0);
+
+ Transaction transaction = table.newTransaction();
+ transaction.newFastAppend().appendFile(file).commit();
+
+ // Commit twice to check that the transaction's keys survive back-to-back
refreshes.
+ table.updateProperties().set("prop", "first").commit();
+ table.updateProperties().set("prop", "second").commit();
+
+
assertThat(SnapshotChanges.builderFor(transaction.table()).build().addedDataFiles())
+ .extracting(DataFile::location)
+ .containsExactly(file.location());
Review Comment:
This is actually the repro that tests the fix works. This checks that the
pending manifest list key is readable within the transaction so that's the bug
reported. This is similar to `transactionCanReadAfterTableRefresh` which also
does this read. (I guess a more complicated operation here on the transaction's
table that causes failure could be used but this felt easiest)
--
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]