rdblue commented on code in PR #18147:
URL: https://github.com/apache/iceberg/pull/18147#discussion_r4031361342
##########
core/src/main/java/org/apache/iceberg/V4ManifestReader.java:
##########
@@ -97,18 +101,30 @@ Schema readSchema() {
/** Returns copies of the tracked files that match this reader's configured
filters. */
@Override
public CloseableIterator<TrackedFile> iterator() {
- CloseableIterable<TrackedFile> entries =
CloseableIterable.transform(open(), this::prepare);
- if (!partitionFilters.isEmpty()) {
- // manifests have no partition, so the partition filter cannot apply to
them
- entries =
- CloseableIterable.filter(entries, entry -> isManifest(entry) ||
matchesPartition(entry));
- }
+ CloseableIterable<TrackedFile> files = CloseableIterable.transform(open(),
this::prepare);
if (!includeAll) {
- entries = CloseableIterable.filter(entries, entry ->
entry.tracking().isLive());
+ files = CloseableIterable.filter(files, file ->
file.tracking().isLive());
+ }
+
+ if (statsFilter != null) {
+ files =
+ CloseableIterable.filter(
+ this::incrementSkipCount,
+ files,
+ file -> statsFilter.eval(file.contentStats(),
file.recordCount()));
+ } else {
+ files =
+ CloseableIterable.filter(
+ this::incrementSkipCount, files, file -> file.recordCount() !=
0L);
Review Comment:
This branch skips files based on record count when there is no row filter.
--
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]