Repository navigation
Add input_format_parquet_detect_variant_by_structure to the Parquet schema inference cache key - #125408
Add input_format_parquet_detect_variant_by_structure to the Parquet schema inference cache key#125408groeneai wants to merge 2 commits into
input_format_parquet_detect_variant_by_structure to the Parquet schema inference cache key#125408Conversation
… key `input_format_parquet_detect_variant_by_structure` (added in ClickHouse#117106) decides whether Parquet schema inference reads an unannotated `{metadata, value}` BYTE_ARRAY group as `Dynamic` or as `Tuple(value String, metadata String)`, but it was missing from the Parquet getter registered with `registerAdditionalInfoForSchemaCacheGetter`. Both values of the setting therefore shared one schema cache entry, and within one server or clickhouse-local process the first query decided the inferred type for every later query on the same source. Append the setting at the end of the key string, so existing `extract(additional_format_info, ...)` probes keep matching. Same class of fix as ClickHouse#113533. The new test runs both orders (1 then 0, 0 then 1) in two clickhouse-local processes; on master it prints Dynamic/Dynamic and Tuple/Tuple. Closes ClickHouse#124986 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 cold review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261012-121500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261012-120300 |
|
Workflow [PR], commit [4da6985] Summary: ❌
AI ReviewSummaryThis PR fixes a real Parquet schema-inference cache poisoning bug by adding Final Verdict✅ No new findings. The previously reported test-flakiness issue is fixed in the current code, so I resolved that review thread. |
`SchemaCache::tryGetImpl` drops an entry when the file's mtime is >= the entry's registration second. The test read the checked-in fixture directly, so it only exercised the cache when the checkout was at least a second older than the first query: with a fresh or future mtime the second `DESC` re-infers and the test goes green on a binary without the fix. Copy the fixture to a unique name and age it with `touch -d`, like the other schema-cache-key tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - 4da6985Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
CIDB has no other Session id: cron:our-pr-ci-monitor:20261012-230010 |
Closes: #124986
Related: #117106
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The schema inference cache for
Parquetnow takesinput_format_parquet_detect_variant_by_structureinto account, so a query gets theDynamicorTupletype its own setting asks for instead of the type inferred by an earlier query on the same file.Description
#117106 made Parquet schema inference read
input_format_parquet_detect_variant_by_structure: an unannotated group with onlymetadataandvalueBYTE_ARRAYfields is inferred asDynamicwhen it is1(the default) and asTuple(value String, metadata String)when it is0(orcompatibilitybelow 26.10). The setting was not part of the Parquet key of the schema inference cache, so within one server orclickhouse-localprocess the first query decided the type for every later query on the same file:The reverse order returned
Tupletwice. This PR appends the setting to the Parquet getter registered withregisterAdditionalInfoForSchemaCacheGetter, next to the other inference-affecting Parquet settings (same approach as #113533). It is appended at the end of the key string, so existingadditional_format_infoprobes keep matching.The new test runs both orders in two
clickhouse-localprocesses. It fails on master (Dynamic, Dynamic, Tuple, Tuple) and passes with the change (50 of 50 runs). The setting exists only on master (no release branch has it), henceNot for changelog.Workflow [PR]
Sync PR [sync-upstream/pr/125408]