Skip to content

Backport #107663 to 26.3: Fix runtime join filter producing wrong results for JSON columns - #109074

Merged
alexey-milovidov merged 2 commits into
26.3from
backport/26.3/107663
Sep 5, 2026
Merged

alexey-milovidov merged 2 commits into
26.3from
backport/26.3/107663

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #107663
Cherry-pick pull-request #108538

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.32.7

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Jul 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [f734bc2]

Summary: ✅

@alexey-milovidov alexey-milovidov self-assigned this Sep 4, 2026
@alexey-milovidov

alexey-milovidov commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

🕵 Merged the current 26.3 branch into this backport (no conflicts).

Root cause of the red Stateless tests (amd_asan, distributed plan, parallel, 2/2) job: the new test 04327_join_runtime_filter_json returned 0 instead of 1 for the multi-path case {"a":1,"b":"x"} only. The code of this backport is identical to master's, but the 26.3 branch at that time lacked the backport of #112601 ("Iterate ColumnObject subcolumns in sorted path order", landed on 26.3 as 1df242f on 2026-08-10). Without it, cloning a shared ColumnObject through IColumn::mutate could visit the dynamic path subcolumns in a different order than the source, so the two dynamic paths were swapped and the runtime filter's equals against the single set element compared {"a":"x","b":1}, dropping the matching row. Single-path cases are unaffected, which is why the other four queries passed, and the release-build libc++ happened to preserve the order, which is why only the ASan job failed.

With the merged 26.3 head, a local 26.3 release build with this fix passes the test in both plan modes (serialize_query_plan 0 and 1) including with the exact randomized settings from the failed CI runs. CI should confirm on the ASan job.

@alexey-milovidov
alexey-milovidov merged commit 01c7692 into 26.3 Sep 5, 2026
35 checks passed
@alexey-milovidov
alexey-milovidov deleted the backport/26.3/107663 branch September 5, 2026 16:18
bytehalo-infra added a commit to sentioxyz/ClickHouse that referenced this pull request Sep 25, 2026
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]>
bytehalo-infra added a commit to sentioxyz/ClickHouse that referenced this pull request Sep 25, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants