[Feature] Optimize partition discovery with projected manifest scans
- Dominant language
- Java
- Stars
- 3.4k
- Forks
- 1.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 396
Description
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
### Motivation
Partition discovery only requires a small subset of manifest fields, but `readPartitionEntries()` currently reads complete manifest entries. This causes unnecessary decoding and object allocation for fields such as key/value statistics and embedded indexes.
Although partition entries are created eagerly, the scan still builds an intermediate list for each manifest before merging the partition statistics.
### Solution
Introduce a projected, streaming manifest scan for partition discovery:
- Project only the fields required for partition aggregation and structural filtering.
- Push partition and bucket filters into the manifest reader.
- Merge projected entries directly into the partition map without per-manifest intermediate lists.
- Fall back to complete manifest entries when active filters require additional fields.
- Preserve the existing cache path for cache-eligible manifests.
This change does not modify the manifest format or partition scan semantics.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing readPartitionEntries() into the manifest reader and identify the fields needed for partition aggregation and structural filtering. Verify how partition and bucket filters, cache-eligible manifests, and the partition map are handled; done means projected entries stream directly into the map while filter-dependent cases still use complete entries and existing scan semantics remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100