Repository navigation
Cherry pick #118796 to 26.6: Iceberg manifest list partition summaries - #119199
Merged
Merged
Conversation
`INSERT`, `DELETE` and `UPDATE` on an Iceberg table left the `partitions` field of every new manifest-list entry null, so a reader could not skip a manifest by its partition and had to open all of them. Only the manifest rewrite done by compaction filled that summary in. Each manifest written by these paths holds exactly one partition tuple, so its field summary is exact: `lower_bound` equals `upper_bound` per partition field. The summary is now built from the same partition values and types that go into `data_file.partition` of the manifest itself, and the code that serializes it is shared with the compaction path instead of being nested in it. Unpartitioned tables keep writing a null summary.
Replaces the stateless test with `test_storage_iceberg_no_spark/test_writes_manifest_list_partition_summary.py`, which reads the Avro metadata directly instead of going through the ClickHouse Avro reader. That distinguishes a null `partitions` field from an empty list, which the stateless variant could not, and it covers `s3` as well as `local` storage and both format versions. Each manifest-list entry is paired with the partition tuple stored in the manifest it points at, so a summary attached to the wrong entry fails the test. The unpartitioned case pins the field staying null, and the `DELETE` case covers both the new position-delete manifest and the data manifests carried forward from the parent snapshot.
…ition_summaries Iceberg manifest list partition summaries
The manifest-list partition summary does not exist on this branch at all, so the parts of the change that only refactor it had to be written out: - `Constant.h`: the four `partitions` field_summary field names. - `IcebergWrites.cpp`: `isNaNPartitionValue` and `<cmath>`. - `generateManifestList`: `entry_partition_summaries` becomes the next optional parameter, after `use_previous_snapshots`. The carry-forward entry path that master refactors has no counterpart here, so that half of the diff is dropped and the summary is written only in the single entry loop this branch has. `Mutations.cpp` keeps its own try/catch and cleanup, and now passes `use_previous_snapshots` explicitly because a later argument follows it. The Avro manifest-list schema already declares `partitions`, `contains_null` and `contains_nan`, so only the C++ side was missing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Original pull-request #118796
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job