Repository navigation
Return original trivial count optimization - #123267
Conversation
|
Workflow [PR], commit [74114ce] Summary: ✅
AI ReviewSummaryThis PR restores the Missing context / blind spots
Findings❌ Blockers
Final Verdict❌ Changes requested. LLVM Coverage ReportMeasured on commit 74114ce.
Changed lines: Changed C/C++ lines covered: 19/23 (82.61%) · Uncovered code |
| if (auto total_rows = actual_data_snapshot->getTotalRows(); total_rows.has_value()) | ||
| { | ||
| ProfileEvents::increment(ProfileEvents::IcebergTrivialCountOptimizationApplied); | ||
| return total_rows; |
There was a problem hiding this comment.
Returning snapshot.summary.total-records - total-position-deletes here makes count() trust writer-maintained summary hints again before we inspect the manifests. That regresses the exactness contract in two ways we already model in-tree: a corrupted historical commit can silently poison total-records, and live delete files still make the summary non-exact (tests/queries/0_stateless/04612_iceberg_count_position_deletes_corrupted_summary.sh documents the 100 - 2 = 98 failure). Because this early return runs before the delete-file guard below, both SELECT count() and the planner statistics built on totalRows() can become arbitrarily wrong for Iceberg tables. Please keep the manifest-file scan as the source of truth, or at minimum prove there are no live delete files and validate the summary against manifest record_count before using it.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes35 object files changed (+46.20 KiB total), 1 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units40 translation units recompiled, 447 s compile time in total, 40 of them have a recent master baseline. |
Do not answer the trivial count from the snapshot summary when the snapshot has equality deletes (`total-equality-deletes` is missing or non-zero): their record count is the number of predicates, not of deleted rows. Adjust the tests to the summary-based count: drop the corrupted-summary part of `04612_iceberg_count_position_deletes_corrupted_summary`, remove `total-records` from the `04615_iceberg_count_negative_record_count` fixture, and disable `optimize_trivial_count_query` in tests that expect `count` to read corrupted manifests. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123267&sha=latest&name_0=PR PR: #123267 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ata-cross-check Conflict resolution: master (#123267) returned the summary-based trivial count for Iceberg: `IcebergMetadata::totalRows` answers from `IcebergDataSnapshot::getTotalRows` when the snapshot summary provides a usable count. Keep that design, and keep this PR's cross-check of the snapshot summary's `total-records` only on the fallback path that sums the manifest files. Accept the deletion of `04611_iceberg_count_ignores_corrupted_snapshot_summary` and `04614_iceberg_count_malformed_manifest_row_counts` from master.
…sed count Master (#123267) answers the trivial count from the snapshot summary when it provides a usable row count, so a table whose manifest files over-report the per-file `record_count` is now counted from the summary, with the optimization applied. Drop the corrupted-summary case, which master deliberately no longer guards against. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Return original trivial count optimization
Workflow [PR]
Sync PR [sync-upstream/pr/123267]
Version info
26.10.1.1240-master(included in26.10and later)