jonvex commented on code in PR #9422:
URL: https://github.com/apache/hudi/pull/9422#discussion_r1300213317


##########
hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestMORColstats.java:
##########
@@ -202,10 +246,23 @@ private void 
testBaseFileAndLogFileUpdateMatchesHelper(Boolean shouldAsyncCompac
       assertEquals(0, 
readMatchingRecords().except(batch1.union(updatedRecord)).count());
     }
 
-    //Corrupt to prove that colstats does not exclude filegroup
-    filesToCorrupt.forEach(TestMORColstats::corruptFile);
-    assertEquals(1, filesToCorrupt.size());
-    assertThrows(SparkException.class, () -> readMatchingRecords().count());
+    if (shouldExecuteCompaction) {
+      doCompaction();
+      filesToCorrupt = getFilesToCorrupt();
+      filesToCorrupt.forEach(TestMORColstats::corruptFile);
+      if (shouldDelete || shouldRollback) {
+        //we corrupt both files in the fg
+        assertEquals(2, filesToCorrupt.size());

Review Comment:
   It was a lot easier to write the getFilesToCorrupt method that way, because 
of the way "_hoodie_file_name" for log files is. 



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to