Repository navigation
Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE"" - #106796
Merged
Merged
Conversation
…d by IN over another materialized CTE""
Contributor
|
Workflow [PR], commit [b951368] Summary: ❌
AI ReviewSummaryThis PR restores the materialized CTE planner/runtime fix that was reverted, including the two-pass CTE materialization resolution, runtime-set safety-net stripping, lazy Missing context / blind spots
Final VerdictStatus: ✅ Approve |
The test `04295_04278_materialized_cte_in_union_runtime_set` failed reproducibly (3/3 reruns) only in the `Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel)` configuration, with: Code: 60. UNKNOWN_TABLE: Unknown table expression identifier '_materialized_cte_ct_<hash>' in scope SELECT __table2.b AS b FROM _materialized_cte_ct_<hash> ... : While executing Remote. A materialized CTE's temporary `StorageMemory` is created only on the initiator. With parallel replicas enabled, the `IN (... UNION ALL ...)` runtime-set subquery that references the CTE is shipped to the replicas as part of the remote query. The replicas re-analyze it but have no such temporary table registered, so resolution fails in `QueryAnalyzer` during `initializeQueryJoinTreeNode`. This is a pre-existing limitation of materialized CTEs under parallel replicas (the storage is not sent to replicas for non-GLOBAL runtime sets), independent of the planner fix this test guards. Exclude the test from parallel-replicas runs. CI history (failures only in the ParallelReplicas config): https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIHRvU3RhcnRPZkRheShjaGVja19zdGFydF90aW1lKSBBUyBkYXksCiAgICBjb3VudCgpIEFTIGZhaWx1cmVzLAogICAgZ3JvdXBVbmlxQXJyYXkocHVsbF9yZXF1ZXN0X251bWJlcikgQVMgcHJzCkZST00gY2hlY2tzCldIRVJFIHRlc3RfbmFtZSA9ICcwNDI5NV8wNDI3OF9tYXRlcmlhbGl6ZWRfY3RlX2luX3VuaW9uX3J1bnRpbWVfc2V0JwogICAgQU5EIHRlc3Rfc3RhdHVzIElOICgnRkFJTCcsICdFUlJPUicpCkdST1VQIEJZIGRheQpPUkRFUiBCWSBkYXkgREVTQwo= Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 177/201 (88.06%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
novikd
approved these changes
Jun 9, 2026
This was referenced Jun 9, 2026
robot-ch-test-poll1
added a commit
that referenced
this pull request
Jun 9, 2026
Cherry pick #106796 to 26.4: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE""
robot-clickhouse
added a commit
that referenced
this pull request
Jun 9, 2026
…d materialized CTE filtered by IN over another materialized CTE""
This was referenced Jun 9, 2026
robot-ch-test-poll1
added a commit
that referenced
this pull request
Jun 9, 2026
Cherry pick #106796 to 26.5: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE""
robot-clickhouse
added a commit
that referenced
this pull request
Jun 9, 2026
…d materialized CTE filtered by IN over another materialized CTE""
alexey-milovidov
added a commit
that referenced
this pull request
Jun 10, 2026
Backport #106796 to 26.5: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE""
alexey-milovidov
added a commit
that referenced
this pull request
Jun 10, 2026
Backport #106796 to 26.4: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE""
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
… for reused materialized CTE filtered by IN over another materialized CTE""
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…6796 Backport ClickHouse#106796 to 26.4: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE""
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #106795
Version info
26.5.3.13,26.4.5.14