Repository navigation
Conversation
A join over two joins that output no columns has two inputs named `__join_result_dummy`, one per side. `JoinStepLogical::serialize` wrote the actions DAG without the side of each input, so `deserialize` inferred it from the input names and failed with `Left and right columns have same names` for a name present in both headers (STID 4752-3ae2, every `make_distributed_plan` task is serialized). The DAG input order does not encode the side either: `swapInputs` swaps the headers and keeps the inputs. `Join` step version 1 (plan version 20) writes one byte per DAG input with its side, and the receiver builds the mapping from it through a new `JoinExpressionActions` constructor. Version 0 keeps the name inference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the motivation clause from the DBMS_MIN_QUERY_PLAN_SERIALIZATION_VERSION_WITH_JOIN_INPUT_SIDES comment and the version comment at the Join step registration, which repeats the constant's name. CI job: https://github.com/ClickHouse/ClickHouse/actions/runs/38013471256/job/114117867192 Reported in: ClickHouse#124938 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 (3 findings). No blocker or major findings; the nits below are noted, not blocking.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-11:20261010-110600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261010-083600 |
|
Workflow [PR], commit [589b1d2] Summary: ✅
AI ReviewSummaryPreserves each Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units366 translation units recompiled, 3667 s compile time in total, 347 of them have a recent master baseline. Translation units without a recent master baseline:
|
Related: #124938
Related: #108787
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A distributed query plan (
make_distributed_plan) now carries the side of every input of a join, so a join over two joins that return no columns, such asSELECT count() FROM t1, t2, t3, t4 WHERE t1.b = t2.b AND t3.a = t4.a, no longer fails withLeft and right columns have same nameswhen the plan is deserialized.Description
Failing CI job: AST fuzzer (amd_debug, targeted, old_compatibility) on #124938 (STID 4752-3ae2). No related open issue found.
A join whose two children are joins that output no columns has two inputs named
__join_result_dummy, one per side. Every task of a distributed plan is serialized and deserialized, also withdistributed_plan_execute_locally = 1.JoinStepLogical::serializewrote the actions DAG without the side of each input, sodeserializeinferred it from the input names, which is impossible for a name present in both headers:LOGICAL_ERROR: Left and right columns have same names: [__join_result_dummy], [__join_result_dummy]. The input order does not encode the side either:swapInputs(Cascades join commutativity) swaps the headers but keeps the DAG inputs, and in the failing plan input 0 is on the right side.Joinstep version 1, written at plan version 20 (the current 26.10 value), adds one byte per DAG input with its side, and the receiver builds the mapping from it through a newJoinExpressionActionsconstructor. Version 0 streams keep the name inference.Validation on a debug build: the new test aborts the master server at its first distributed statement in 20 of 20 randomized runs and passes on this branch in 50 of 50, with every distributed result equal to the same query without the distributed plan. The existing join step serialization and step version unit tests pass.
This supersedes #108787, which keeps the inference and assigns input 0 to the left side, wrong for a swapped join.
Workflow [PR]
Sync PR [sync-upstream/pr/125071]