szehon-ho commented on code in PR #6365: URL: https://github.com/apache/iceberg/pull/6365#discussion_r1083250975
########## core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java: ########## @@ -1040,4 +1047,195 @@ public void testAllManifestsTableSnapshotNot() { expectedManifestListPaths(table.snapshots(), 1L, 3L, 4L), actualManifestListPaths(manifestsTableScan)); } + + @Test + public void testPositionDeletesWithFilter() { + Assume.assumeTrue("Position deletes supported only for v2 tables", formatVersion == 2); + preparePartitionedTable(); + + PositionDeletesTable positionDeletesTable = new PositionDeletesTable(table); + + Expression expression = + Expressions.and( + Expressions.equal("partition.data_bucket", 1), Expressions.greaterThan("pos", 0)); + BatchScan scan = positionDeletesTable.newBatchScan().filter(expression); + assertThat(scan).isExactlyInstanceOf(PositionDeletesTable.PositionDeletesBatchScan.class); + + List<ScanTask> tasks = Lists.newArrayList(scan.planFiles()); + + Assert.assertEquals( Review Comment: Added new tests for ScanMetrics. These cover number of manifests skipped and read. Somejhow the existing ManifestReader code we invoke does not update metrics about number of deleteFiles skipped and read (at least in the code path we use): https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/ManifestReader.java#L228 -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org