Skip to content

[core]save the runtime memory while reading all the partitions or buckets - #8745

Merged
JingsongLi merged 2 commits into
apache:masterfrom
weijietong:metadata_mem_p1
Jul 21, 2026
Merged

[core]save the runtime memory while reading all the partitions or buckets#8745
JingsongLi merged 2 commits into
apache:masterfrom
weijietong:metadata_mem_p1

Conversation

@weijietong

@weijietong weijietong commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Purpose

Optimize readPartitionEntries and readBucketEntries in AbstractFileStoreScan to use per-entry converter during manifest reading, so ManifestEntry objects (with heavy DataFileMeta including stats, key ranges, embedded index, etc.) are immediately converted to lightweight PartitionEntry/BucketEntry and never accumulated. This reduces peak memory per manifest file from holding a full List to only a List — each DataFileMeta (~20 fields, several KB) is discarded after extracting the 3 needed values (rowCount, fileSize, creationTime), while PartitionEntry only retains ~6 fields (~40 bytes). For tables with millions of files the savings can be significant.

Tests

Added FileStoreScanPartitionBucketEntryTest covering single/multiple partition aggregation, multi-file merge within the same partition, partition filter pushdown, append-only table variant, and equivalent bucket entry tests — including the previously untested readBucketEntries() method which had zero coverage.

- Change ManifestEntryCache and ObjectsCache to use the cache path for storage
- Update SimpleObjectsCache with related improvements
- Add FileStoreScanPartitionBucketEntryTest for testing

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi
JingsongLi merged commit 077f058 into apache:master Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants