HIVE-29829: Iceberg: Stream partition column statistics on write, prune them on read - #6707
Merged
Merged
Conversation
deniskuzZ
marked this pull request as draft
August 18, 2026 17:14
deniskuzZ
force-pushed
the
col_stats_refactor
branch
from
August 19, 2026 08:13
8c845b2 to
273ca7f
Compare
deniskuzZ
force-pushed
the
col_stats_refactor
branch
2 times, most recently
from
August 19, 2026 20:52
f73473a to
04270e5
Compare
deniskuzZ
force-pushed
the
col_stats_refactor
branch
from
August 20, 2026 15:09
04270e5 to
8efb3d0
Compare
deniskuzZ
force-pushed
the
col_stats_refactor
branch
from
August 21, 2026 00:11
8efb3d0 to
7fd415e
Compare
deniskuzZ
force-pushed
the
col_stats_refactor
branch
from
August 24, 2026 12:17
f18bae6 to
7e96137
Compare
deniskuzZ
force-pushed
the
col_stats_refactor
branch
from
August 24, 2026 13:09
7e96137 to
7d9a760
Compare
Contributor
|
This PR is a bit overwhelming, so I’m mostly reviewing to learn and understand the new flow! |
difin
reviewed
Sep 1, 2026
difin
reviewed
Sep 1, 2026
difin
reviewed
Sep 1, 2026
difin
reviewed
Sep 1, 2026
difin
reviewed
Sep 2, 2026
difin
approved these changes
Sep 2, 2026
difin
reviewed
Sep 2, 2026
Contributor
|
PR description lists |
Contributor
|
There are 43 Sonar issues, some looks actionable, like replacing String concatenation blocks with |
Member
Author
removed, it was extracted into separate PR |
A partitioned table's column statistics are stored one Puffin blob per partition - every column's entry framed behind its field id and length, bit vector included - together with table-level aggregates, one entry per column, folded from the partitions. A gather streams through the writer a batch at a time, and a merge carries forward, byte for byte, the blobs of partitions no write has changed. The storage-handler SPI takes the gather as an iterator where it took a list. The table metadata registers only what a read can answer without opening the file: the table-level aggregates and one partition entry carrying the combined column list and a numPartitions property. Blob offsets live in the file's own footer; a pruned read filters it by partition name, coalesces the wanted blobs into runs, and fetches them in one vectored call - S3A merges the ranges and issues them four at a time. A whole-table read is served from the aggregates alone, and an ask of another partition count is turned away from the metadata with no I/O. A read decodes the columns it was asked for and steps over the rest. Whether stored statistics still describe the data is decided from the snapshot the file was written for: ANALYZE stores what it read, an overwrite what it replaced, a major compaction of one current-spec partition refreshes it; a plain INSERT maintains none, and its partitions read as stale until recomputed. A branch's statistics stay on the branch.
|
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.



What changes were proposed in this pull request?
Per-partition column statistics for Iceberg tables have been reworked end to end, covering how they are stored, written, and read during scans, as well as how readers determine whether the statistics still accurately describe the underlying data.
Why are the changes needed?
Performance driven optimization and design refactor
Does this PR introduce any user-facing change?
No
How was this patch tested?
qtests:
depends on #6711