Repository navigation
Conversation
…supported An INSERT into an Iceberg table whose schema contains a column that cannot be serialized into a statistics bound wrote no lower_bounds/upper_bounds at all for the data file, losing the bounds of every supported column too. Those maps drive min/max file pruning, so one Array/Map/Tuple/Decimal/Float/UInt* column silently disabled file-level pruning for the whole table, for ClickHouse's own reader and for external readers alike. canWriteStatistics was a whole-vector predicate: it returned false on the first field whose bound canDumpIcebergStats rejects, and its two callers used that as an all-or-nothing gate. Skipping set_fields leaves the Avro union on its null branch, which surfaces as an empty map. A column that is entirely NULL trips the same veto, because ColumnNullable::getExtremes yields POSITIVE_INFINITY, a Field of type Null. Replace it with filterWritableStatistics, which returns the subset of bounds that can be serialized; the callers write that subset when it is non-empty. An omitted field is simply absent from the map, which readers already treat as "bound unknown" and skip (ManifestFileIterator, ManifestFilesPruning), and the compaction path already emits such partial maps. The partition-summary path in this same file already performs the identical per-field skip with the same predicate, so the data-file path becomes consistent with its sibling. When no field is serializable, nothing is written, exactly as before. The gate deliberately stays canDumpIcebergStats rather than "does dumpFieldToBytes support it": the byte dumper handles a strictly wider set and throws LOGICAL_ERROR on the rest, so filtering now guarantees that precondition by construction instead of relying on the veto having covered every element. Measured per release branch: 26.7, 26.6, 26.5 and 26.3 reproduce; 25.8 has no allow_insert_into_iceberg. The introducing commit is not identified. Closes ClickHouse#112706 Co-Authored-By: Claude Fable 5 <[email protected]>
Internal second-model review (click to expand)Two independent reviews ran against this change before it was published: an Gate: 0 findings. Independent cold review: 2 nits, 0 majors, 0 blockers.
Points independently re-derived rather than taken from the author's notes:
Session id: cron:clickhouse-review-slot-11:20260801-161502 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-42:20260801-153200 |
|
cc @divanik @SmitaRKulkarni, could you review this? |
|
Workflow [PR], commit [6915015] Summary: ❌
AI ReviewSummaryThis PR changes fresh Iceberg manifest bound writing from an all-or-nothing gate to a per-field filter, so unsupported or all- Final Verdict✅ No findings. LLVM Coverage Report |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 17/17 (100.00%) · Uncovered code |
|
Fixing PR for the pre-auth That PR reapplies #110760 (reverted in #112935) together with the fix: |
CI finish ledger for 4d2ac97Every failure below has an owner: a fixing PR, or a full-effort fix task whose fixing-PR link will be posted here when it opens.
174 of 174 check-runs completed, Not caused by this diff, which keeps Iceberg statistics for supported columns. Independent breadth: 74 rows across 40 distinct carriers on 2026-08-01 alone, with 9 master rows across 4 distinct master SHAs and 5 Stress flavours including the non-sanitizer The link for this failure was already posted separately at issuecomment-5154157256; this ledger records it in the table for completeness. Session id: cron:our-pr-ci-monitor:20260802-010000 |
Resolves the conflict with ClickHouse#112414, which merged first and renamed the statistics source in generateManifestFile from data_file_statistics to effective_statistics. The resolution keeps this branch's per-field filterWritableStatistics mechanism and applies it to the new source, so both call sites read effective_statistics->getLowerBounds()/getUpperBounds() through the filter. ClickHouse#112414 added 04652_iceberg_insert_per_file_statistics, whose reference asserted the all-or-nothing output this branch fixes: the two data files holding an all-NULL score recorded lower=[] upper=[], dropping the bound of the id column along with it. Those two rows now carry the id bound, [(1,2)] and [(1,3)]. Its comments described that loss as pre-existing behaviour asserted rather than fixed, which no longer holds, so they now state the per-field rule instead. Renamed the new test from 04693 to 04739. Master took 04693 for five unrelated tests while this branch was open, and check_gaps_in_tests_numbers only flags gaps, never collisions, so a duplicate number ships silently under green CI. 04739 is free on master, across all 2077 open pull requests and in the fleet worktrees. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Merged master (the branch was 29 days behind). The diff grew from 3 files to 5, so the earlier approval no longer covers all of it. The conflict was #112414, which merged first and renamed the statistics source in Two follow-on edits the merge made necessary:
Validation on the merged tree: both tests pass with the fix and both fail on a pristine build of the same merged master ( |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 19 s compile time in total, 7 of them have a recent master baseline. |
CI finish ledger -
|
| Check / test | Reason | Owner / fixing PR |
|---|---|---|
Integration tests (amd_llvm_coverage, 4/8) / Container memory budget exceeded (/docker) |
not PR-caused, CI-harness resource defect on master: the /docker cgroup leaf that parents the nested test containers is capped at 40.78 GiB, and ClickHouseCluster.shutdown() issues docker compose stop with no --timeout, so every container's dump_stacktraces_on_shutdown attaches gdb -batch -ex 'thread apply all bt' at once. The kernel's own OOM task table shows around 9 concurrent gdb holding 4.1-4.3 GiB anon each, roughly 90 percent of everything the leaf held when it died, against servers of 0.16-0.40 GiB. The diff here is Iceberg statistics plus two stateless .sh tests, so it adds no integration test to this shard and cannot reach the harness's cgroup sizing. |
#117202 (external, open) |
That PR is the remedy for this exact fan-out rather than a same-area coincidence: it puts a
job-wide flock around the shutdown gdb invocation in
tests/integration/integration-tests-entrypoint.sh, re-checking the server pid once the lock is
held, and its description cites the same CIDB occurrences of this signature, including the true
master one. It is the only other open PR touching that file.
No other check failed at this head, and Config Workflow, Style check and Finish Workflow are
all success with 0 nodes DROPPED.
Session id: cron:our-pr-ci-monitor:20260831-083000
|
Dear @scanhex12, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
b48ea16
Backport #112934 to 26.9: Keep Iceberg statistics for supported columns when a field type is unsupported
Backport #112934 to 26.7: Keep Iceberg statistics for supported columns when a field type is unsupported
Backport #112934 to 26.8: Keep Iceberg statistics for supported columns when a field type is unsupported
One conflict, at the two call sites in `IcebergWrites.cpp`. The helper rename and its all-or-nothing to per-field change merged on their own; only the callers collided, because master reads `effective_statistics` (the per-file statistics this branch does not have) where this branch reads `data_file_statistics`, and master wraps the `if` bodies in braces where this branch does not. Resolved to the branch's variable and brace style over the new `filterWritableStatistics`. `04652_iceberg_insert_per_file_statistics` does not exist on this branch, so its half of the change is dropped. Nothing is lost: that hunk only re-baselines an existing test's expectations and comments to the new per-field bounds, while the coverage for the change itself is the new `04739_iceberg_insert_partial_statistics_bounds`, which carries over unchanged. Checked for the new test: `allow_insert_into_iceberg` and `USER_FILES_PATH` are both here, and `canDumpIcebergStats` differs from master's only by the four `Decimal*` cases, which the test does not exercise. No other test on this branch asserts written Iceberg bounds, so the all-or-nothing to per-field flip cannot break one silently. The source resolution is byte-identical to the one on private release/26.4. Upstream: #112934 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cherry pick #112934 to 26.3: Keep Iceberg statistics for supported columns when a field type is unsupported
…ns when a field type is unsupported
Backport #112934 to 26.3: Keep Iceberg statistics for supported columns when a field type is unsupported
…rted columns when a field type is unsupported
…rted columns when a field type is unsupported
…rted columns when a field type is unsupported
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed Iceberg
INSERTwriting nolower_bounds/upper_boundsat all into the manifest entry when the table has a column whose type cannot be serialized into a statistics bound (for exampleArray(Int32)), or a column that is entirelyNULL. Such a field is now omitted individually and the bounds of every other column are still written, so min/max file pruning keeps working. Closes #112706.Description
Closes #112706
Related: #112414
What breaks. An
INSERTinto(key Int32, arr Array(Int32))producedlower_bounds = []/upper_bounds = [], losingkey's bounds too. Those maps drive min/max file pruning, so oneArray/Map/Tuple/Float/UInt*column silently disabled file-level pruning for every column,for ClickHouse and external readers alike.
Root cause.
canWriteStatisticsinIcebergWrites.cppwas a whole-vector predicate, returningfalseon the first field whose boundcanDumpIcebergStatsrejects. Its two callers used it as anall-or-nothing gate, so one unserializable column skipped the only code that writes the bounds
array, leaving the Avro union on its
nullbranch. An all-NULLNullablecolumn trips the sameveto, its extremes returning
Null.The change.
canWriteStatisticsbecomesfilterWritableStatistics, returning the serializablesubset, which the callers write when non-empty. An omitted field is simply absent from the map,
which readers already treat as "bound unknown" and skip (
ManifestFileIterator,ManifestFilesPruning), and the compaction path already emits such partial maps. Thepartition-summary path in this same file already does this per-field skip with the same predicate.
When nothing is serializable, nothing is written, as before. The gate stays
canDumpIcebergStatsrather than the byte dumper, which accepts a wider set and throws on the rest. No format or setting
change.
Validation. New
04739_iceberg_insert_partial_statistics_bounds.shcovers an unsupported type,an all-
NULLNullablecolumn, an all-supported control, and aNullable(Float64)wrapper. Itfails on the unpatched binary and passes with the fix (rebuilt both ways, build ids verified), and
passes under repeated randomized-settings runs. Measured per branch: 26.7, 26.6, 26.5, 26.3
reproduce; 25.8 has no
allow_insert_into_iceberg. The introducing commit is not identified.#112414has since merged. Its04652_iceberg_insert_per_file_statisticsasserted the oldempty-bounds output for the two all-
NULLfiles, so this branch updates those rows to the boundsnow kept for
idand corrects the comments calling that loss intended.Workflow [PR]
Sync PR [sync-upstream/pr/112934]
Version info
26.10.1.355-master(included in26.10and later)26.9.2.10,26.8.11.33,26.7.14.14,26.3.33.138