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


##########
core/src/test/java/org/apache/iceberg/TestScanPlanningAndReporting.java:
##########
@@ -130,6 +130,71 @@ public void scanningWithDeletes() throws IOException {
     
assertThat(scanReport.scanMetrics().totalDeleteFileSizeInBytes().value()).isEqualTo(20L);
   }
 
+  @Test
+  public void scanningWithSkippedDataFiles() throws IOException {
+    String tableName = "scan-planning-with-skipped-data-files";
+    Table table =
+        TestTables.create(
+            tableDir, tableName, SCHEMA, SPEC, SortOrder.unsorted(), 
formatVersion, reporter);
+    table.newAppend().appendFile(FILE_A).appendFile(FILE_D).commit();
+    table.newAppend().appendFile(FILE_B).appendFile(FILE_C).commit();
+    TableScan tableScan = table.newScan();
+
+    try (CloseableIterable<FileScanTask> fileScanTasks =
+        tableScan.filter(Expressions.equal("data", "1")).planFiles()) {
+      fileScanTasks.forEach(task -> {});
+    }
+
+    ScanReport scanReport = reporter.lastReport();
+    assertThat(scanReport).isNotNull();
+    assertThat(scanReport.tableName()).isEqualTo(tableName);
+    assertThat(scanReport.snapshotId()).isEqualTo(2L);
+    
assertThat(scanReport.scanMetrics().skippedDataFiles().value()).isEqualTo(1);
+    
assertThat(scanReport.scanMetrics().skippedDeleteFiles().value()).isEqualTo(0);
+    
assertThat(scanReport.scanMetrics().totalPlanningDuration().totalDuration())
+        .isGreaterThan(Duration.ZERO);
+    
assertThat(scanReport.scanMetrics().resultDataFiles().value()).isEqualTo(1);
+    
assertThat(scanReport.scanMetrics().resultDeleteFiles().value()).isEqualTo(0);
+    
assertThat(scanReport.scanMetrics().scannedDataManifests().value()).isEqualTo(1);
+    
assertThat(scanReport.scanMetrics().skippedDataManifests().value()).isEqualTo(1);
+    
assertThat(scanReport.scanMetrics().totalDataManifests().value()).isEqualTo(2);
+    
assertThat(scanReport.scanMetrics().totalDeleteManifests().value()).isEqualTo(0);
+    
assertThat(scanReport.scanMetrics().totalFileSizeInBytes().value()).isEqualTo(10L);
+    
assertThat(scanReport.scanMetrics().totalDeleteFileSizeInBytes().value()).isEqualTo(0L);
+  }
+
+  @Test
+  public void scanningWithSkippedDeleteFiles() throws IOException {

Review Comment:
   @rdblue is there a good/easy way to test scan planning with skipped delete 
files?



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