Repository navigation
Cherry pick #106796 to 26.5: Revert "Revert "Fix LOGICAL_ERROR for reused materialized CTE filtered by IN over another materialized CTE"" - #106861
Merged
Conversation
…d by IN over another materialized CTE""
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]>
…1-fix-mat-cte 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.
Original pull-request #106796
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job