stevenzwu commented on code in PR #18147:
URL: https://github.com/apache/iceberg/pull/18147#discussion_r4031423646
##########
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());
Review Comment:
Status-first makes sense. Stats before partition is the opposite of
`ManifestReader`, which short-circuits `evaluator.eval(partition) &&
metricsEvaluator.eval(file)`. Partition eval is typically cheaper than bounds,
so files that fail the partition residual still pay for
`InclusiveStatsEvaluator` here. When partition filtering is rewritten, worth
combining into one predicate with partition first (or keeping partition ahead
of stats).
--
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]