Skip to content

Cherry pick #118796 to 26.3: Iceberg manifest list partition summaries - #119198

Merged
PedroTadim merged 4 commits into
backport/26.3/118796from
cherrypick/26.3/118796
Sep 14, 2026
Merged

PedroTadim merged 4 commits into
backport/26.3/118796from
cherrypick/26.3/118796

Conversation

@robot-clickhouse-ci-2

Copy link
Copy Markdown
Contributor

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-pick locally.
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:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

scanhex12 and others added 3 commits September 8, 2026 11:42
`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
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Sep 10, 2026
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@maxknv maxknv removed the external Author is not a member of the ClickHouse organization label Sep 11, 2026
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`.

This branch's entry loop is a range-for, but the summary is written per
index, so the loop is now indexed and rebinds `manifest_entry_name` - the
same form master uses. The carry-forward entry path that master refactors
has no counterpart here, so that half of the diff is dropped.

Both call sites keep this branch's older signature (`filename_generator`,
`Strings`, a single `manifest_length`) and now pass `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]>
@PedroTadim
PedroTadim merged commit 06813f5 into backport/26.3/118796 Sep 14, 2026
@PedroTadim
PedroTadim deleted the cherrypick/26.3/118796 branch September 14, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants