Repository navigation
Resolve Iceberg manifest entry fields without enumerating the whole manifest schema - #127782
Conversation
AvroForIcebergDeserializer parses a manifest into one Tuple column and resolves every field the entry parser reads (status, data_file.file_path, data_file.lower_bounds, ...) with IDataType::hasSubcolumn, getSubcolumn and getSubcolumnType. Each of those enumerates the streams of the whole manifest_entry type, so a manifest cost ~60 full type walks regardless of how many entries it has (~2 ms per manifest, ~80% of the parse). When every component of the path is an element of a named Tuple, take the element column and type directly. For a tuple element the generic lookup returns exactly that pointer and type (SerializationTuple passes them to SerializationNamed, whose subcolumn creator returns its argument), so the result is unchanged. Paths through Array, Nullable, Map or absent fields still use the generic lookup. 200 manifests, cache off, one thread: 0.476 s -> 0.141 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
use_iceberg_metadata_files_cache is read when the table's metadata object is created, so the existing query's query-level use_iceberg_metadata_files_cache = 0 does not reach a table created with the cache on, and that query is served from the cache. The twin table is created with the setting, so its query reads all 200 manifests per run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review (2 nits). Nothing blocking.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261025-145700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261025-144400 |
|
cc @scanhex12 @arsenmuk, could you review this and add the |
|
Workflow [PR], commit [ab44a7e] Summary: ❌
AI ReviewSummaryOptimizes Iceberg and Paimon manifest field lookup by walking tuple elements directly, and adds a performance query with the metadata cache disabled at table creation. No actionable findings remain in PR #127782 at head Missing context / blind spots
Final VerdictStatus: ✅ Approve. No changes requested. |
CI finish ledger - ab44a7eEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The first run of this head stopped at Session id: cron:our-pr-ci-monitor:20261027-203012 |
167a443
Related: #127100
Related: #127061
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reading the manifest files of an Iceberg table is faster: fields of a manifest entry are now taken directly from the parsed record instead of enumerating the whole manifest schema for every field. Listing the files of a table with many manifests that are not in the metadata cache is about 3 times faster.
Description
AvroForIcebergDeserializer::extractSubcolumnWithTyperesolved every field the manifest entry parser reads (status,data_file.file_path,data_file.lower_bounds, ...) withIDataType::hasSubcolumn,getSubcolumnandgetSubcolumnType. Each of them enumerates the streams of the wholemanifest_entrytype, so a manifest cost about 60 full type walks (~2 ms) whatever its number of entries; this was ~80% of the parse in a profile of 200 one-file manifests (discussed in #127100).When every component of the path is an element of a named
Tuple, the element column and type are taken directly (DataTypeTuple::tryGetPositionByName,ColumnTuple::getColumnPtr). That is the same pointer and type the generic lookup returns for a tuple element. Other paths (throughArray,Nullable,Map, or absent fields) use the generic lookup as before.Local RelWithDebInfo builds of
7f4a629(master before #127100) with and without the change,icebergLocal,use_iceberg_metadata_files_cache = 0, results identical:WHERE id < 0,max_threads = 1count(), sum(id),max_threads = 1max_threads = 1The Iceberg and Paimon stateless and integration tests pass with a temporary check (not committed) that compared both lookups on every call: no mismatch.
use_iceberg_metadata_files_cacheis read when the table is created, so the existing query oficeberg_data_manifests.xmlis served from the metadata cache and does not see this change. I added a twin table created with the cache off, which reads all 200 manifests on every run (localperf.py: 0.106 s -> 0.029 s).🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127782]
Version info
26.11.1.1717-master(included in26.11and later)