Repository navigation
Conversation
…ks hash A correlated subquery with a non-trivial correlation is decorrelated into an internal join. With correlated_subqueries_use_in_memory_buffer enabled (default), that join is restricted to hash-family algorithms via std::erase_if. When the user's join_algorithm enabled neither hash nor parallel_hash (auto, grace_hash, partial_merge, full_sorting_merge), the algorithm list became empty and chooseJoinAlgorithm threw a misleading NOT_IMPLEMENTED on a valid query. Fall back to hash join when the restriction would otherwise empty the list. Hash join always supports this internal join and satisfies the in-memory buffer requirement. Closes: ClickHouse#103294 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-3:20260720-145100 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings across 1 full pass + 1 delta recheck; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-3:20260720-145100 |
|
cc @novikd @yakov-olkhovskiy — could you review this? It fixes issue #103294: with the in-memory buffer opt, the internal decorrelation join is restricted to hash-family algorithms via |
|
Workflow [PR], commit [d9fd5a7] Summary: ❌
AI ReviewSummaryThis PR fixes a real planner bug in correlated subquery decorrelation: when Final Verdict
|
CI finish ledger — 82d7b8eEvery failure below has an owner: a fixing PR, or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
Session id: cron:our-pr-ci-monitor:20260720-213000 |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 4/4 (100.00%) · Uncovered code |
CI finish ledger — d9fd5a7Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose
Session id: cron:our-pr-ci-monitor:20260729-164745 |
|
Fixing PR for the It corrects the read bound of the per-part product quantization codebook, which is the |
|
This PR is no longer needed |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a
NOT_IMPLEMENTEDerror ("Can't execute any of specified algorithms...") for correlated subqueries with a non-trivial correlation whenjoin_algorithmdid not includehashorparallel_hash(e.g.auto,grace_hash,partial_merge,full_sorting_merge).Description
When a correlated subquery has a non-trivial correlation (e.g. an inequality), it is decorrelated into an internal join. With
correlated_subqueries_use_in_memory_bufferenabled (the default), that internal join is restricted to hash-family algorithms so the buffered input stream is fully evaluated before the subquery runs. The restriction did this with an unconditionalstd::erase_ifon the join's algorithm list: if the user'sjoin_algorithmenabled neitherhashnorparallel_hash, the list became empty andchooseJoinAlgorithmthrew a misleadingNOT_IMPLEMENTED.The internal decorrelation join must still run in that case, so it now falls back to
hashwhen the restriction would otherwise empty the list. Hash join always supports this join and satisfies the in-memory buffer requirement.Reproducer (failed before, works now):
Closes: #103294