Repository navigation
Fix runtime join filter producing wrong results for JSON columns - #107663
Conversation
The `ValuesCount::ONE` optimization in `RuntimeFilterBase` extracted a `Field` from the Set element column and reconstructed a `ColumnConst` via `DataType::createColumnConst`. This round-trip was lossy for JSON columns: `ColumnDynamic::get` returned e.g. `Field(Int64(1))`, but `FieldToDataType` narrowed it to `Int8` when inserting back into a fresh `ColumnDynamic`. `ColumnDynamic::compareAt` then saw different variant type names (`Int64` vs `Int8`) and returned "not equal", causing the join to incorrectly filter out matching rows. Fix: store the column from `Set::getSetElements` directly and wrap it in `ColumnConst` instead of going through the `Field` intermediary. This preserves the original column representation exactly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [8dfe402] Summary: ❌
AI ReviewSummaryThis PR fixes the PR MetadataThe changelog category should be Suggested replacement changelog entry: Also move the issue link out of the changelog entry and put it on its own relationship line: Missing context / blind spots
Final VerdictStatus: ✅ Approve Minimum required actions: none for the code. The PR metadata cleanup above is recommended before merge. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 6/6 (100.00%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
Cherry pick #107663 to 26.6: Fix runtime join filter producing wrong results for JSON columns
…ults for JSON columns
Backport #107663 to 26.6: Fix runtime join filter producing wrong results for JSON columns
Cherry pick #107663 to 26.3: Fix runtime join filter producing wrong results for JSON columns
…ults for JSON columns
Cherry pick #107663 to 26.4: Fix runtime join filter producing wrong results for JSON columns
…ults for JSON columns
Cherry pick #107663 to 26.5: Fix runtime join filter producing wrong results for JSON columns
…ults for JSON columns
Backport #107663 to 26.5: Fix runtime join filter producing wrong results for JSON columns
Backport #107663 to 26.4: Fix runtime join filter producing wrong results for JSON columns
Backport #107663 to 26.3: Fix runtime join filter producing wrong results for JSON columns
…er-json-field-roundtrip Fix runtime join filter producing wrong results for JSON columns
NULL/RF: a runtime join filter on JSON columns compares the wrong representation and drops matching rows. Effect in the production build a394e92: wrong (the upstream test fails on it and passes on official 26.8.8.8; evidence/fix_ci_20260925/upstream_repro). Upstream patch unchanged, with its test(s): 04327_join_runtime_filter_json Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fixes 05059_formatDateTime_extralong_timezone (ClickHouse#117925) and 04327_join_runtime_filter_json (ClickHouse#107663) join the stateless selection (97 tests); known_defects.json gets their entries (40, 0 open). Co-Authored-By: Claude Opus 5.5 <[email protected]>
JSON: ColumnObject iterated its typed/dynamic path columns in hash-map order -> JSON join keys with several paths miss in the exact-values runtime filter. Effect in the production build a394e92: without it the 04327_join_runtime_filter_json case with two JSON paths still returns 0 after the ClickHouse#107663 backport (a33ab46) on the candidate 91efe1f244ce, deterministically and with join_runtime_filter_exact_values_limit = 0 as the only workaround; official 26.8.8.8 returns 1. The 26.3 branch merged this backport (ClickHouse#114224, 2026-08-12) before the ClickHouse#107663 backport (ClickHouse#109074, 2026-09-05), so the upstream test passed there. Upstream patch unchanged, with its test(s): -. No test of its own; 04327_join_runtime_filter_json (from the ClickHouse#107663 backport) is the regression test. 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):
Fix runtime join filter producing wrong results for JSON columns. Closes #107646
Version info
26.7.1.79(included in26.7and later)26.6.2.18,26.4.5.94,26.3.32.7