Repository navigation
Conversation
|
Workflow [PR], commit [c8afacb] Summary: ✅
AI ReviewSummaryThis PR switches Findings❌ Blockers
Final Verdict❌ Changes requested — the optional-total plumbing is on the right track, but the full-table LLVM Coverage ReportMeasured on commit c8afacb.
Changed lines: Changed C/C++ lines covered: 277/301 (92.03%) · Uncovered code |
| /// them only for the snapshot that introduced the manifest; otherwise a carried-forward | ||
| /// file is attributed to several rebuilt snapshots and its rows are counted multiple | ||
| /// times in the summary totals (`total-records`), inflating a trivial `SELECT count()`. | ||
| if (plan.manifest_file_to_first_snapshot[manifest_file.manifest_file_path] != snapshot.snapshot_id) |
There was a problem hiding this comment.
This still keys row ownership by manifest, not by file entry. ManifestFileIterator::processRow already resolves a per-entry snapshot_id from the manifest row (parsed_snapshot_id or the inherited manifest-list id), because a manifest may contain EXISTING files from older snapshots. With the new manifest_file_to_first_snapshot filter, a manifest that was rewritten or merged in a later APPEND will move all of those older files into that later snapshot during OPTIMIZE.
That breaks rebuilt history: earlier snapshots lose data they still owned, and the later snapshot's total-records / time-travel results become wrong. The fix needs to group data files by each entry's resolved snapshot_id (or sequence), not by the first snapshot that referenced the manifest file.
749cbb0 to
2822236
Compare
|
📊 Cloud Performance Report ✅ AI verdict: This PR is confined to Iceberg snapshot-summary metadata generation (append/overwrite/replace total accounting, unknown-total propagation) and its tests; it does not touch any query-execution hot path that ClickBench exercises. The two flagged ClickBench deltas (Q4 -18.3%, Q15 -20.9%) are both apparent improvements that the deterministic gate correctly held at no_change as within-envelope variance, and that matches the diff — the changed code never runs for these MergeTree SELECTs. No real per-query effect; the suppressions look consistent with the change. clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 234/269 (86.99%) · Uncovered code |
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
e0c1401 to
ff16f36
Compare
| .added_files = static_cast<UInt64>(data_files_count), | ||
| .added_records = static_cast<UInt64>(data_rows), | ||
| .added_files_size = static_cast<UInt64>(delete_bytes + data_bytes), | ||
| .added_delete_files = static_cast<UInt64>(delete_files_count), |
There was a problem hiding this comment.
delete_files in this path are always position-delete files, but the typed SnapshotSummaryUpdateOverwrite still leaves added_position_delete_files at 0. overwriteIsPositionDeleteOnly later uses that field to decide whether an OVERWRITE is a delete-only snapshot it can compact (Compaction.cpp:992-995), and it only tolerates the field being absent when there is exactly one delete file. A mutation that touches two partitions will therefore write added_delete_files = 2, fail that predicate, and make OPTIMIZE TABLE reject the history as unsupported even though nothing but position deletes was added.
Please set added_position_delete_files = delete_files_count here and add a multi-partition regression test for OPTIMIZE after a mutation.
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
`SnapshotSummary` derives the `total-*` fields of an overwrite, delete or replace from the parent snapshot and throws a `LOGICAL_ERROR` when there is none, which aborts the sanitizer unit test binaries. Production writers only emit such updates against a table with a current snapshot, so `OverwriteOperationForDelete` and `ReplaceOperationIsPreserved` now append a first snapshot and pass its id as the parent. CI: https://s3.amazonaws.com/clickhouse-test-reports/PRs/109288/b52a5fc3cc489c88643939083faa075160d03481/pr/unit_tests_msan/job.log PR: #109288 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ator MetadataGenerator::generateNextMetadata now takes a typed Iceberg::SnapshotSummaryUpdate instead of six loose Int64 counters and builds the snapshot summary through SnapshotSummary, so the totals follow the optional-propagation rules instead of ad-hoc string sums. It also fails close when a positive parent snapshot id does not resolve to a snapshot in the metadata or its summary cannot be read (except v1, where summary fields are optional), instead of silently treating the parent totals as zero. Extracted from the Iceberg ALTER TABLE DROP PARTITION branch (dk-iceberg-alter-drop-partition). Co-Authored-By: Claude Fable 5 <[email protected]>
Relink each rebuilt snapshot to the previously generated one (not the original parent, which may be a skipped DELETE) so the fail-close parent-totals check holds, and attribute each data file only to the snapshot that introduced its manifest so a carried-forward file is not counted in every later snapshot's summary totals (which inflated SELECT count()). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
…ignature The test was added on master after this branch changed `generateNextMetadata` to take `Iceberg::SnapshotSummaryUpdate`, so the rebase left it calling the removed six-counter overload and the `Build (arm_tidy)` check failed to compile. Co-Authored-By: Claude Fable 5 <[email protected]>
`SnapshotSummary` derives the `total-*` fields of an overwrite, delete or replace from the parent snapshot and throws a `LOGICAL_ERROR` when there is none, which aborts the sanitizer unit test binaries. Production writers only emit such updates against a table with a current snapshot, so `OverwriteOperationForDelete` and `ReplaceOperationIsPreserved` now append a first snapshot and pass its id as the parent. CI: https://s3.amazonaws.com/clickhouse-test-reports/PRs/109288/b52a5fc3cc489c88643939083faa075160d03481/pr/unit_tests_msan/job.log PR: #109288 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…NIFEST` `test_optimize_manifest_parent_summary_missing_totals` still asserted the old behaviour, where a `total-*` counter missing from the parent snapshot summary was written as "0" on the manifest-only snapshot. Snapshot summaries now carry an unknown total forward as unknown, like Spark, so the stripped fields must stay absent while the totals the parent does know are carried over unchanged. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=109288&sha=7f2d2b41f12392abaac72c548b8d4464f6c3119a&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%208%2F8%29 PR: #109288 Co-Authored-By: Claude Fable 5.1 <[email protected]>
7f2d2b4 to
c8afacb
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units39 translation units recompiled, 392 s compile time in total, 39 of them have a recent master baseline. Median compile-time ratio to the baselines is ×0.92 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Add experimental `ALTER TABLE ... DROP PARTITION` support for local and object-storage Iceberg tables when every affected manifest is fully matched. Reject catalog-backed tables, evolved specs, and partially matched manifests before metadata writes. Preserve history with a `DELETE` snapshot, carry unaffected manifests forward, and handle an empty manifest list safely. Related: #109288
Related: #105198
Related: #108634
SnapshotSummaryTotalsoptionals, so if a member wasn't find in the initial snapshot it won't be update to some wrong values (it seems that Spark does the same)MetadataGenerator::generateNextMetadatausesIceberg::SnapshotSummaryUpdateOPTIMIZEmetadata rebuild chains rebuilt snapshots to each other and attributes each data file only to the snapshot that introduced its manifest, fixing inflatedtotal-records(andSELECT count()) afterOPTIMIZE.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Iceberg snapshot summary
total-*fields now propagate unknown totals instead of treating them as 0, andOPTIMIZEno longer inflatestotal-records, which madeSELECT count()wrong afterOPTIMIZE.Workflow [PR]
Sync PR [sync-upstream/pr/109288]