Repository navigation
Conversation
JingsongLi
requested changes
Nov 20, 2026
JingsongLi
left a comment
Contributor
There was a problem hiding this comment.
Can I just add it directly, rather than passing a bool? Also, the name "tuple" seems a bit odd—aren't these just statistics at the field level?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Addresses #5683 in the shared multi-partition statistics predicate.
Suppose the requested partitions are
(day=1, event=A)and(day=19, event=B). A manifest spanning days 9 through 11 passes the combined bounds even though neither requested partition occurs in that range. This can cause scans and overwrite commits to open unnecessary manifest bodies.After the combined bounds pass, compare the field values of each requested partition with the per-field manifest statistics. Stop at the first possible match. Skip the manifest only when at least one field rules out each requested partition. Unknown statistics and null counts are handled conservatively. A single requested partition is already covered by the existing bounds check.
The existing
fromMultiplecallers share this behavior, including ordinary manifest scans, overwrites, full compaction, and manifest sort. Per-partition values are decoded once during predicate construction. Manifest bounds are decoded once for the inner loop.Tests
PartitionPredicateTest,ManifestFileMetaTest,ManifestFileTest,NoPartitionManifestFileMetaTest,KeyValueFileStoreScanTestandFileStoreCommitTest.The worst case takes work proportional to candidate manifests × distinct requested partitions × partition fields. In a single-thread local JDK 8 microbenchmark with 13,151 synthetic candidate manifests and five string fields, only the last partition matched every candidate. Checking 288 partitions took about 0.4 s, 682 took about 0.9 s, and 10,000 took 19–24 s. The previous combined-bounds check took under 0.02 s for these cases. These timings measure calls to the statistics predicate alone, with zero files pruned.