Repository navigation
Fix wrong results with parallel_hash JOIN and read-in-order-through-join - #109225
harikrishnan94 merged 35 commits into
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-5:20260702-194900 |
|
cc @vdimir @KochetovNicolai — could you review this? It stops the read-in-order-through-join optimization from advertising the left sort order across PartialMergeJoin (which re-scans left key ranges per right block and so does not preserve it), fixing wrong DISTINCT results in release and the sorted-DISTINCT LOGICAL_ERROR in debug (#109216). New IJoin::preservesLeftBlockOrder() gates the propagation; hash/direct joins are unchanged. |
|
Workflow [PR], commit [c356add] Summary: ✅
AI ReviewSummaryThis PR narrows Tests
Final Verdict
LLVM Coverage ReportMeasured on commit c356add.
Changed lines: Changed C/C++ lines covered: 17/20 (85.00%) · Uncovered code |
…-in-order
The read-in-order-through-join optimization propagated read-in-order (and the
left sort property) through any INNER/LEFT ALL/ANY join without delayed blocks.
This is only valid for joins that stream the left side through once (hash,
direct). PartialMergeJoin (join_algorithm = partial_merge / prefer_partial_merge)
matches the left stream against the right side per right block, re-emitting left
key ranges for each right block, so when the right side has more than one block
equal left-key values are no longer contiguous in the joined stream.
With the left sort property falsely advertised, optimize_distinct_in_order plants
a DistinctSortedStreamTransform on top of the join. Its equal-range search assumes
sorted (contiguous equal) input, so:
- release builds silently return wrong DISTINCT results (duplicate rows);
- debug/sanitizer builds hit the "Equal values are not contiguous within the
range assumed to be sorted" LOGICAL_ERROR and abort.
Fix: add IJoin::preservesLeftBlockOrder() (default true) and require it in
findReadingStep before propagating read-in-order through a join.
- MergeJoin (PartialMergeJoin): false, re-scans left per right block.
- JoinSwitcher: false, may switch to MergeJoin at runtime.
- FullSortingMergeJoin: false, re-sorts the left side by the join keys. In
practice its "Sort before JOIN" step already stops findReadingStep before the
join, but the join genuinely does not preserve left order, so the contract is
made explicit and robust against future plan changes.
Hash/direct/concurrent-hash keep the optimization unchanged; GraceHashJoin and
SpillingHashJoin were already excluded via hasDelayedBlocks().
Test 04498 freezes merges on the right table (SYSTEM STOP MERGES) so the two
inserts stay as two separate right-side blocks; without that a background merge
could collapse them and let the unfixed plan pass spuriously. Verified both
directions: the test aborts with the LOGICAL_ERROR on an unfixed binary and
returns the correct 6 rows for partial_merge, prefer_partial_merge and
full_sorting_merge with the fix.
Fixes ClickHouse#109216
Co-Authored-By: Claude Opus 4.8 <[email protected]>
9325ef4 to
c1b6c29
Compare
|
Pre-PR validation gate for the updated fix (widened to full_sorting_merge, deterministic test): Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-4:20260702-233000 |
The read-in-order-through-join fix in this PR made findReadingStep (second pass) also require IJoin::preservesLeftBlockOrder(), so it no longer propagates read-in-order through partial_merge / prefer_partial_merge (MergeJoin), full_sorting_merge (FullSortingMergeJoin), or auto (JoinSwitcher). topKThroughJoin's pass-1 deferral (second_pass_can_apply) still only excluded joins with delayed blocks. With spilling off and the join side pinned, it kept deferring the sound Sort + Limit pushdown to a second pass that now bails on !preservesLeftBlockOrder(), so neither optimization fired and a query like LEFT ALL JOIN ... ORDER BY left_pk LIMIT n fell back to a full join plus a full sort on exactly those algorithms. Mirror preservesLeftBlockOrder in the deferral via joinMayNotPreserveLeftBlockOrder, so the pushdown runs in pass 1 for non-order-preserving algorithms. Order-preserving joins (hash, direct, concurrent hash) are unchanged and still defer to read-in-order. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Pre-PR validation gate for the topKThroughJoin deferral fix (b19568b), which widens this PR beyond the Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260703-004400 |
| /// PartialMergeJoin does not: it re-scans left key ranges once per right block, so equal | ||
| /// left-key values are no longer contiguous once the right side has more than one block. | ||
| /// The read-in-order-through-join optimization relies on this to keep the left sort property. | ||
| virtual bool preservesLeftBlockOrder() const { return true; } |
There was a problem hiding this comment.
ConcurrentHashJoin cannot keep the new default preservesLeftBlockOrder() == true. When HashJoin::chooseMethod(..., use_two_level_maps = true) falls back to key8, key16, or the single-LowCardinality map types, ConcurrentHashJoin::joinBlock scatters the left block across slots and ConcurrentHashJoinResult emits slot 0, then 1, etc. A left stream like (a, k) = (0, 0), (0, 1), (1, 0), (1, 1) therefore comes out as (0, 0), (1, 0), (0, 1), (1, 1), so equal a values are no longer contiguous even though the input was sorted by a.
That means optimize_distinct_in_order / optimizeReadInOrder can still apply sorted consumers unsafely for join_algorithm = 'parallel_hash' on those key shapes. Because topKThroughJoin runs before physical join conversion, the logical mirror in joinMayNotPreserveLeftBlockOrder also needs to stop deferring on JoinAlgorithm::PARALLEL_HASH unless the key shape is proven to use a two-level map.
There was a problem hiding this comment.
Confirmed and fixed in 3737f8b.
chooseMethod(use_two_level_maps=true) (HashJoin.cpp) leaves key8 / key16 and the single non-nullable LowCardinality path single-level, and ConcurrentHashJoin::joinBlock only passes the left block through unscattered when twoLevelMapIsUsed(). So the fix is precise rather than a blanket disable:
- Physical:
ConcurrentHashJoin::preservesLeftBlockOrder()now returnstwoLevelMapIsUsed(). Read-in-order still propagates for two-level key shapes (verified: UInt64 key keepsRead type: InOrder), and stops for single-level ones. - Logical (
topKThroughJoin):parallel_hashis treated as non-order-preserving only when it is forced without ahashfallback. With the defaultdirect,parallel_hash,hashlist the planner picks plainHashJoinfor small right sides (order preserving), and when it switches toConcurrentHashJoinfor a large right side the second pass's physical gate above still refuses order propagation, so correctness holds either way. This avoids disabling the deferral for the common hash-fallback path (04209 / 04230 / 04234).
Repro (debug), single-level key8, optimize_aggregation_in_order=1: before, GROUP BY a returned a=0..6 -> 1, a=7 -> 57; after, every a returns its correct count. Covered in 04498 (correctness + an EXPLAIN assertion that read-in-order is not planted for the single-level key but still is for a UInt64 key) and 04499 (the pushdown fires for forced parallel_hash).
There was a problem hiding this comment.
parallel_hash with a hash fallback is still not safe to defer unconditionally. In the current code, PlannerJoins::tryCreateJoin picks ConcurrentHashJoin whenever PARALLEL_HASH is enabled and rhs_size_estimation is absent or above the threshold, even if HASH is also enabled (src/Planner/PlannerJoins.cpp:1234-1238). joinMayNotPreserveLeftBlockOrder in src/Processors/QueryPlan/Optimizations/topKThroughJoin.cpp:119-127 only checks for the presence of a HASH fallback, so it still defers for direct,parallel_hash,hash.
If that physical join then lands on a single-level ConcurrentHashJoin, pass 2 bails out on preservesLeftBlockOrder() == false and we again lose both optimizations. So the original top-k part of this thread is still present for the HASH-fallback / no-estimate-or-large-RHS path; the current fix only covers forced parallel_hash.
There was a problem hiding this comment.
Confirmed and fixed in 2dd2e59.
Reproduced on the pre-fix binary: direct,parallel_hash,hash + a UInt8 (key8, single-level) join key + a right side >= parallel_hash_join_threshold -> tryCreateJoin picks ConcurrentHashJoin, pass 1 deferred (the old guard only fired without a hash fallback), pass 2 bailed on !preservesLeftBlockOrder(), so the left read was Default and no Limit was pushed (full join + full sort).
rhs_size_estimation is only filled in the second pass and the map type is unknown at this logical stage, so I cannot mirror tryCreateJoin's choice here. I dropped the !hash_fallback carve-out: parallel_hash is now treated as possibly non-order-preserving whenever it is enabled. Running the pushdown is never worse than deferring: the injected Sort + Limit on the left is itself satisfied by a read-in-order scan of the primary key when applicable. Verified via EXPLAIN that the default-list large-RHS single-level case now streams the left InOrder with a pushed Limit 10, and the two-level (UInt64) case is unchanged in correctness.
Coverage: added a default-list (parallel_hash + hash fallback) pushdown assertion to 04499 (guard-sensitive: 0 pre-fix, 1 post-fix). Pinned join_algorithm = 'hash' in 04209/04230/04234 so those keep exercising the read-in-order / swap / FINAL deferral gate with an order-preserving algorithm.
There was a problem hiding this comment.
ConcurrentHashJoin::preservesLeftBlockOrder() itself still looks correct, but the top-k part from this thread is back in the current code. topKThroughJoin still defers based only on !joinMayHaveDelayedBlocks(...) at src/Processors/QueryPlan/Optimizations/topKThroughJoin.cpp:329-335, so a parallel_hash,hash logical join can still defer even when the eventual physical ConcurrentHashJoin later reports preservesLeftBlockOrder() == false for a single-level map (src/Interpreters/ConcurrentHashJoin.h:78). That recreates the "both optimizations disabled" path for the fallback / large-RHS case.
There was a problem hiding this comment.
🕵 Both parts of this thread now point at master's code, not at this PR's diff.
ConcurrentHashJoin::preservesLeftBlockOrder() — the correctness fix — is confirmed still in place (src/Interpreters/ConcurrentHashJoin.h:79), and it is the only physical gate that matters for read-in-order: findReadingStep reads it directly (optimizeReadInOrder.cpp:162).
The topKThroughJoin deferral heuristics for a logical join (joinMayHaveDelayedBlocks / joinMayNotPreserveLeftBlockOrder) were dropped from this PR during the rework, after #110671 landed the findReadingStep gate on master; the only change left in topKThroughJoin.cpp is a comment. So the behaviour described here is master's current behaviour, unchanged by this branch, and it is a lost-optimization (perf) case rather than a wrong result: the Sort + Limit pushdown that the deferral falls back to is itself sound. Tracking it as a follow-up instead of re-expanding a Bug Fix PR that is still awaiting human review.
…evel maps ConcurrentHashJoin (join_algorithm = 'parallel_hash') builds its inner HashJoins with two-level maps, but chooseMethod leaves a single 1-byte (key8) or 2-byte (key16) numeric key, or a single non-nullable LowCardinality key, single-level. For those key shapes joinBlock scatters the left block across slots and ConcurrentHashJoinResult emits slot 0, then 1, ..., so equal left-key values stop being contiguous even for a sorted left input. Inheriting the default preservesLeftBlockOrder() == true let optimize_distinct_in_order / optimizeReadInOrder plant a sorted DISTINCT/aggregation consumer on that scattered stream, giving wrong results (and LOGICAL_ERROR in debug/sanitizer builds). Override ConcurrentHashJoin::preservesLeftBlockOrder() to twoLevelMapIsUsed(): the order is preserved only when the shared two-level map keeps the left block unscattered. This is precise, so read-in-order still fires for two-level key shapes. topKThroughJoin runs before physical join selection, where the map type is unknown. Mirror the gate there for parallel_hash only when it is forced without a hash fallback; when hash is also enabled the planner picks plain HashJoin (order preserving) unless the right side is large, and in that switched case the second pass's physical gate still refuses order propagation. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Pre-PR validation gate for the parallel_hash / ConcurrentHashJoin fix (commit 3737f8b), addressing the fourth review finding. Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-2:20260703-021400 |
…allback The pass-1 deferral in topKThroughJoin only treated parallel_hash as non-order-preserving when it was forced without a hash fallback. But PlannerJoins::tryCreateJoin still picks ConcurrentHashJoin for the default direct,parallel_hash,hash list when there is no right-side estimate or the right side is at least parallel_hash_join_threshold, and a single-level map key (key8 / key16 / single non-nullable LowCardinality) then scatters the left order. The map type and right-side size are unknown at the logical stage (rhs_size_estimation is filled in the second pass), so a hash fallback does not guarantee order preservation. In that case the deferral bailed in the second pass on the physical !preservesLeftBlockOrder() gate and both the Sort+Limit pushdown and read-in-order were lost, leaving a full join plus a full sort. Treat parallel_hash as possibly non-order-preserving whenever it is enabled and run the pushdown in pass 1; the injected Sort+Limit is itself satisfied by a read-in-order scan when applicable, so it is never worse. Pin join_algorithm='hash' in the 04209/04230/04234 gate tests so they keep exercising the read-in-order / swap / FINAL deferral gate with an order-preserving algorithm. Add a default-list (parallel_hash + hash fallback) pushdown assertion to 04499. Pin the read-in-order trio in the 04498 parallel_hash key8 block and both EXPLAIN probes so CI randomization of query_plan_read_in_order cannot make the guard go blind. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260703-040100 |
The parallel_hash and direct,parallel_hash,hash pushdown assertions test the logical-stage mirror (joinMayNotPreserveLeftBlockOrder over JoinStepLogical), which only exists in the new analyzer. Under the old analyzer topKThroughJoin sees the already-built physical ConcurrentHashJoin and reads its exact preservesLeftBlockOrder() (true for the two-level UInt64 map used here), so it correctly defers and read-in-order fires instead. That is a different but equally correct plan with no explicit pushed Limit, so the assertion returned 0 under the old-analyzer job. Pin enable_analyzer=1 on both the wrapper and the EXPLAIN subquery so the two assertions stay deterministic on both analyzers. The old-analyzer job forbids changing enable_analyzer inside a subquery when the session value differs, hence the pin on both levels. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Fixup pushed (4b13612): the The Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-4:20260703-083300 |
The 04499 top-k-through-join regression used a right table with a 100x fan-out, so a LEFT ALL JOIN made the top-10 rows all pk = 0. A pushdown that kept only the first left row (a wrong Limit 1) or attached the limit to the wrong side would still return ten pk = 0 rows and keep the assertions green, so the test did not actually prove the topKThroughJoin contract. Make the join one-to-one (each left key matches exactly one right row) so the correctness probes return the exact top-10 pk 0..9. A wrong pushed limit now changes the returned rows instead of hiding behind equal pk. The EXPLAIN probes still assert the pushed Limit step fires for every non-order-preserving algorithm; the one-to-one correctness probes pin its value and side. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260703-092701 |
…sion buildInputOrderInfo(DistinctStep) only traverses the join when query_plan_read_in_order_through_join is on. The stateless runner randomizes it (and the rest of the read-in-order trio); when it lands at 0 the sorted consumer is never planted, so the partial_merge / prefer_partial_merge / full_sorting_merge queries return the correct 6 rows even on an unfixed binary and the guard goes blind. Pin the trio on those queries so the through-join path this test guards is actually exercised. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-5:20260703-111800 |
ConcurrentHashJoin::preservesLeftBlockOrder() returned twoLevelMapIsUsed(), which is false for single-level maps (key8, key16, single non-nullable LowCardinality). But with one slot (max_threads == 1, so slots == 1) dispatchBlock short-circuits on num_shards == 1 and joinBlock passes the left block through unscattered regardless of the map type, so order is preserved. PlannerJoins::tryCreateJoin can build a ConcurrentHashJoin with max_threads == 1, and the strict predicate then disabled read-in-order / optimize_distinct_in_order / optimize_aggregation_in_order / LIMIT BY in-order on a join that actually satisfies the contract. Return `slots == 1 || twoLevelMapIsUsed()`. Add a focused max_threads = 1 key8 regression to 04498 asserting the in-order path fires again and stays correct, alongside the existing multi-slot (gated) and two-level (fires) cases. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-2:20260703-125000 |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units161 translation units recompiled, 1699 s compile time in total, 161 of them have a recent master baseline. |
CI finish ledger - b339930Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
Nothing else is red at this commit: Measured breadth for the harness row, 30 days over all Session id: cron:our-pr-ci-monitor:20260828-070000 |
|
Fixing PR for the generic |
|
Dear @vdimir, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
This agentic fix looks related to this other agentic fix: #110671 @groeneai Replace the existing test cases by a simple test with a minimal reproducible example. Avoid slop (like "load-bearing") in all shapes and forms. @harikrishnan94: The problem is real, could I ask you to take a look at the PR? |
The three test files added by this PR covered every join algorithm that touches the read-in-order-through-join gate. Most of those arms already behaved correctly on master: partial_merge is covered by 04500_read_in_order_through_partial_merge_join, full_sorting_merge is blocked by its own pre-JOIN sort, and the rest were EXPLAIN plan probes rather than result oracles. The only shape whose classification this change moves is parallel_hash with a single-level map, which returns wrong results without it. That is now the whole test: 04498_parallel_hash_read_in_order_through_join, one query, 8 groups of 8 rows. Measured with a debug build of this branch and a debug build of master: 10/10 runs pass with the fix, 5/5 runs fail on master under the test runner's default randomization (the runner injected query_plan_read_in_order_through_join=0, optimize_aggregation_in_order=0 and max_threads=1, all of which the query-level SETTINGS override, so the defective path is exercised every run). Source comments are trimmed to the local invariant. The comment in FullSortingMergeJoin.h is dropped: it described the absence of an override. The 04209 comment is corrected instead of extended, because FullSortingMergeJoin no longer reports that it preserves the left order. No behaviour change: the diff under src/ against the previous head is comments only.
|
Done in c746029. The three test files are replaced by one, What I dropped: the Source comments went from 33 added lines to 12, and the one in |
|
@groeneai Can confirm RIGHT/FULL join non joined processed rows are also taken care of? |
| @@ -0,0 +1,23 @@ | |||
| -- `parallel_hash` does not keep the order of the left table for a narrow join key, so read-in-order | |||
There was a problem hiding this comment.
The reduced repro is good for the parallel_hash wrong-result carrier, but the code in this PR also explicitly opts ConstantJoin and DirectKeyValueJoin back into read_in_order_through_join after flipping the IJoin default to fail-closed. I couldn't find a remaining focused FilledJoinStep probe for either path: 03711 proves HashJoin / ConcurrentHashJoin, and 04652_direct_join_dictionary_sparse_key keeps max_threads = 1 and does not pin the read-in-order settings, so it never exercises the same boundary.
Could we keep one small LEFT JOIN ... ON 1 = 1 or dictionary EXPLAIN / result probe alongside this repro? Otherwise those opt-ins are effectively untested on the current head.
There was a problem hiding this comment.
Correct for ConstantJoin and DirectKeyValueJoin: neither has a focused plan assertion on this head. That gap is already stated on the PR with a standing offer to add one, and the call is the reviewers': @ rschu1ze asked for the existing cases to be replaced by a single minimal reproducible example, so re-adding arms unasked would undo that. I will add exactly the probe that is asked for.
For the parallel_hash carrier the coverage is already in-tree: forcing ConcurrentHashJoin::preservesLeftBlockOrder to return false makes the existing 03711_read_in_order_through_join fail, with six ReadType lists flipping to Default while the 'hash' arm stays unchanged.
|
@harikrishnan94 Yes. The two mechanisms are disjoint on join kind, so a non-joined-rows stream is never present in a plan this PR's classification can affect.
Measured on the test's two tables with
The reduced test asserts only the |
CI finish ledger -
|
| Check / test | Reason | Owner / fixing PR |
|---|---|---|
Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) / Container memory budget exceeded (/docker) |
/docker cgroup leaf OOM kills the concurrent shutdown gdb attaches; job ERROR, no test failed |
#117202 (external, merged 2026-08-31), absent from this tree |
Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) / Container memory budget exceeded (/docker) |
same leaf OOM as above | #117202 (external, merged 2026-08-31), absent from this tree; a fix task owns the 6/6 residual noted below |
Integration tests (amd_tsan, 2/6) / Container memory budget exceeded (/docker) |
same leaf OOM as above | #117202 (external, merged 2026-08-31), absent from this tree |
All three rows are one signature, not three. The /docker cgroup leaf that bounds the nested
test containers is capped at 40.78 GiB, and docker compose stop signals every node of a
cluster at once, so each node that outlives the 60 s deadline attaches gdb at the same moment.
On an ASan build each attach holds about 3.4 GiB of anonymous memory, so a nine-node cluster asks
for roughly the whole leaf and the kernel kills the debuggers. #117202 serializes that attach.
It is merged, but it is outside the tree this run built: the fix symbol GDB_ATTACH_LOCK is
absent at c746029e98ab and present at the merge commit 7fc3004ed25a, and compare reports
this head behind that commit. So the run predates the fix. These rows clear when the branch next
picks master up. I am not merging master here purely to re-run CI, to keep the review load down.
Measured caveat, stated so it is not a surprise later: on true-master trees that DO contain
#117202, the 2/6 and 5/6 shards are clean (0 of 13 post-fix trees) but 6/6 still fires
(13 of 13, every one at 1214-1215 test rows with no failing test). So a 6/6 row may return
after the master merge. A fix task owns that residual and its fixing-PR link will be posted here
when one opens.
Bugfix validation (functional tests, amd64/aarch64) are green. Both carry a FAIL row for
04209_top_k_through_join_read_in_order_gate, which is this PR's own new test running against a
pre-fix binary, so that row is the intended proof the test reproduces the bug, not a failure.
Mergeable Check and PR are praktika aggregators. They report the rows above and carry no
separate defect. Config Workflow, Style check and CH Inc sync are all success on this head.
Session id: cron:our-pr-ci-monitor:20260831-203000
|
Let's merge from master and then merge @harikrishnan94 |
|
Merged master in: 728cc58 |
CI finish ledger - 728cc58Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose
Session id: cron:our-pr-ci-monitor:20260903-053000 |
|
@groeneai What is pending? Why the checks still failing? Make this PR merge-ready. |
|
Nothing is pending on my side. Of the 170 checks on The other non-green entry is To pick the fix up in the head itself I merged master |
Closes: #116913
Related: #109216
Related: #110671
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed wrong results when
join_algorithm = 'parallel_hash'is combined with a sorted consumer such asoptimize_aggregation_in_order,optimize_distinct_in_orderorLIMIT BY. With several join slots and a single-level hash map the join does not keep the order of the left table, so the read-in-order-through-join optimization must not advertise the left sort order in that case.Description
Minimal reproducible example, wrong on master:
Master returns
1, 1, 1, 1, 1, 1, 1, 57; the correct answer is 8 per group.chooseMethodleaves a key that materializes to one or two bytes single-level, and for a single-level map the left block is scattered across the slots and emitted slot by slot, so equal values of the left sorting key stop being contiguous while the ordered read is still installed.The fix flips the
IJoin::preservesLeftBlockOrder()default that #110671 introduced fromtruetofalse, so a join keeps the left order only if it says so:HashJoin,DirectKeyValueJoin,ConstantJoinandPasteJoinunconditionally,ConcurrentHashJoinonly when it does not scatter. That also makesFullSortingMergeJoinsafe by property rather than by plan shape: on master it inheritstrueand is safe only because aSortstep happens to sit between the join and the read.Validated with debug builds of this branch and of master: the new test passes 10/10 runs here and fails 5/5 on master under the runner's default randomization. The stricter default costs nothing where the order really holds -
03711_read_in_order_through_joinstill assertsReadType: InOrderforhashandparallel_hash, and it fails if either safe branch is removed.Workflow [PR]
Sync PR [sync-upstream/pr/109225]
Version info
26.9.1.767(included in26.9and later)