rdblue commented on a change in pull request #2358: URL: https://github.com/apache/iceberg/pull/2358#discussion_r639149470
########## File path: core/src/main/java/org/apache/iceberg/PartitionsTable.java ########## @@ -80,21 +88,51 @@ private DataTask task(TableScan scan) { return StaticDataTask.Row.of(partition.key, partition.recordCount, partition.fileCount); } - private static Iterable<Partition> partitions(Table table, Long snapshotId) { - PartitionMap partitions = new PartitionMap(table.spec().partitionType()); - TableScan scan = table.newScan(); + private Iterable<Partition> partitions(StaticTableScan scan) { + CloseableIterable<FileScanTask> tasks = planTasks(scan); - if (snapshotId != null) { - scan = scan.useSnapshot(snapshotId); + PartitionMap partitions = new PartitionMap(table().spec().partitionType()); + for (FileScanTask task : tasks) { + partitions.get(task.file().partition()).update(task.file()); } + return partitions.all(); + } - for (FileScanTask task : scan.planFiles()) { - partitions.get(task.file().partition()).update(task.file()); + @VisibleForTesting + CloseableIterable<FileScanTask> planTasks(StaticTableScan scan) { + boolean caseSensitive = scan.isCaseSensitive(); + boolean ignoreResiduals = scan.shouldIgnoreResiduals(); Review comment: Nit: I'd probably move this into the if clause since it is only used once. -- 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. 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