Repository navigation
Build Iceberg min/max hyperrectangles only for columns the filter uses - #122681
Conversation
`ManifestFileIterator::processRow` decoded the lower/upper bounds of every column of every manifest entry and looked up each column through `IcebergSchemaProcessor::tryGetFieldCharacteristics`, although `ManifestFilesPruner::canBePruned` only reads the ranges of the columns that appear in the filter. Each lookup takes the shared lock of the table-wide `SharedMutex`, walks a map holding the fields of every schema version and copies a `NameAndTypePair`, so with many decode threads and concurrent queries the lookups contend on the same cache lines and dominate the query. The pruner now resolves the types of its min/max columns once, when it is built, and `processRow` iterates over those columns only. `canBePruned` uses the same cached types instead of a lookup per entry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [3ad7536] Summary: ✅
AI ReviewSummaryThis PR narrows Iceberg min/max hyperrectangle decoding to the columns that the filter can actually use, by caching the relevant manifest-schema Missing context / blind spots
Final Verdict✅ No actionable findings in the current diff. LLVM Coverage ReportMeasured on commit 3ad7536.
Changed lines: Changed C/C++ lines covered: 53/56 (94.64%) · Uncovered code |
|
processRow is minimized and tryGetFieldCharacteristics too |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
Backport #122681 to 26.9: Build Iceberg min/max hyperrectangles only for columns the filter uses
Two conflicts, both in the include blocks of files master also changed since `caf26def`; no logic was touched to resolve them. `ManifestFilesPruning.cpp`: master added `Common/DateLUT.h`, `Core/DecimalFunctions.h` and `base/arithmeticOverflow.h` where this branch added `DataTypes/DataTypeLowCardinality.h`. All four are kept. `StorageObjectStorageSource.cpp`: master added `Interpreters/castColumn.h` where this branch added `Interpreters/addMissingDefaults.h`. Both are kept. Master's ClickHouse#122681 builds the min/max hyperrectangles and the new date partition ranges only for the field ids in `used_columns_in_filter`, which is the list this branch filters, so a column whose declared type the pruner must not compare stays unpruned on those paths too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`test_iceberg_narrow_manifest_bounds` fails on every master run since ClickHouse#122679 restored its file: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=eb34e3144cb9f262e3b7dc8a6b49e0371dbac2d0&name_0=MasterCI&name_1=Integration%20tests%20%28amd_msan%2C%208%2F8%29 ClickHouse#122681 made `ManifestFileIterator::processRow` decode the bounds of only the columns the filter uses (`getMinMaxColumnTypes`). The test narrows the bound of `n` and then greps for the width guard's log line after a read filtered on `s` alone, which no longer decodes `n`, so the grep returns nothing. The CI of ClickHouse#122681 did not run this file, because ClickHouse#122485 had removed it at the time. The same change made the module's four other checks that a well-formed column in the same manifest entry keeps pruning vacuous: each filtered on the well-formed column alone, so the broken bound was never decoded and the check passed whatever the per-column fallback did. The five per-column checks now also filter on the broken column. The pruner keeps one `KeyCondition` per filter column with only that column as key, so the other column's atom is unknown and the conjunction prunes exactly as the single-column filter did; the expected counts are unchanged. Validated with two mutants that make the width guard or the inverted-pair guard drop min/max pruning for the whole entry instead of one column: each reddens the new file at exactly the checks of its own guard, while the old file's checks at those sites stay green. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry pick #122681 to 26.8: Build Iceberg min/max hyperrectangles only for columns the filter uses
Cherry pick #122681 to 26.7: Build Iceberg min/max hyperrectangles only for columns the filter uses
Cherry pick #122681 to 26.3: Build Iceberg min/max hyperrectangles only for columns the filter uses
…for columns the filter uses
…for columns the filter uses
…for columns the filter uses
Backport #122681 to 26.8: Build Iceberg min/max hyperrectangles only for columns the filter uses
Backport #122681 to 26.3: Build Iceberg min/max hyperrectangles only for columns the filter uses
Backport #122681 to 26.7: Build Iceberg min/max hyperrectangles only for columns the filter uses
…gles only for columns the filter uses



Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Build Iceberg min/max hyperrectangles only for columns the filter uses
Workflow [PR]
Sync PR [sync-upstream/pr/122681]
Version info
26.10.1.943-master(included in26.10and later)26.9.6.4,26.8.15.21,26.7.19.9,26.3.38.4