nastra commented on code in PR #15148:
URL: https://github.com/apache/iceberg/pull/15148#discussion_r2767192889


##########
core/src/test/java/org/apache/iceberg/TestSetStatistics.java:
##########
@@ -106,4 +106,55 @@ public void testRemoveStatistics() {
     assertThat(version()).isEqualTo(3);
     assertThat(metadata.statisticsFiles()).isEmpty();
   }
+
+  @TestTemplate
+  public void testSetStatisticsRetryWithConcurrentModification() {
+    table.newFastAppend().appendFile(FILE_A).commit();
+    long snapshotId = readMetadata().currentSnapshot().snapshotId();
+
+    GenericStatisticsFile statisticsFile =
+        new GenericStatisticsFile(
+            snapshotId, "/some/statistics/file.puffin", 100, 42, 
ImmutableList.of());
+
+    TestTables.TestTable currentTable = table;

Review Comment:
   I don't think we need this variable. Updating this section to 
   ```
   +    TableOperations concurrentOps =
   +        new TestTables.TestTableOperations("test", tableDir, 
table.ops().io()) {
   +          private boolean firstAttempt = true;
   +
   +          @Override
   +          public void commit(TableMetadata base, TableMetadata metadata) {
   +            if (firstAttempt) {
   +              firstAttempt = false;
   +              table.newFastAppend().appendFile(FILE_B).commit();
   +            }
   +
   +            super.commit(base, metadata);
   +          }
   +        };
   ```
   
   produces the same output



-- 
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]

Reply via email to