Skip to content

Do not use parallel replicas with non-leftmost RIGHT join#84299

Merged
KochetovNicolai merged 2 commits intomasterfrom
vdimir/issue_81144
Jul 30, 2025
Merged

Do not use parallel replicas with non-leftmost RIGHT join#84299
KochetovNicolai merged 2 commits intomasterfrom
vdimir/issue_81144

Conversation

@vdimir
Copy link
Copy Markdown
Member

@vdimir vdimir commented Jul 23, 2025

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

  • Fix LOGICAL_ERROR for queries with parallel replicas and multiple INNER joins followed by RIGHT join. Do not use parallel replicas for such queries

Close #81144

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jul 23, 2025

Workflow [PR], commit [16afd65]

Summary:

job_name test_name status info comment
Stateless tests (amd_asan, distributed plan, sequential) failure
00002_log_and_exception_messages_formatting FAIL
Stateless tests (amd_ubsan, parallel) failure
01825_new_type_json_ghdata_insert_select FAIL

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 23, 2025
}
else if (
join_table_expression_node_type == QueryTreeNodeType::TABLE || join_table_expression_node_type == QueryTreeNodeType::TABLE_FUNCTION)
else if (join_table_expression_node_type == QueryTreeNodeType::TABLE || join_table_expression_node_type == QueryTreeNodeType::TABLE_FUNCTION)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logical error is here, we do not handle JOIN for that query. We could add support of JOIN as well in this if, however query still fails with "unknown database _table_function" error

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume, unknown _table_function error is about remote() in subquery, see issue #74226

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revisit after #84330 merged

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revisit after #84330 merged

It has been merged

@vdimir vdimir requested a review from devcrafter July 23, 2025 13:24
@devcrafter devcrafter self-assigned this Jul 23, 2025
@KochetovNicolai
Copy link
Copy Markdown
Member

00002_log_and_exception_messages_formatting and 01825_new_type_json_ghdata_insert_select are known to be broken

@KochetovNicolai KochetovNicolai added this pull request to the merge queue Jul 30, 2025
Merged via the queue into master with commit 01b6bb1 Jul 30, 2025
243 of 246 checks passed
@KochetovNicolai KochetovNicolai deleted the vdimir/issue_81144 branch July 30, 2025 16:44
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 30, 2025
@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Aug 1, 2025

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=84299&sha=16afd65890fcd0ffe1049faf823b2527a54d2120&name_0=PR&name_1=Stateless+tests+%28amd_binary%2C+ParallelReplicas%2C+s3+storage%2C+parallel%29&name_2=Tests

SKIPPED 03208_multiple_joins_with_storage_join 0.80
2025-07-28 23:41:55 Reason: return code: 49
2025-07-28 23:41:55 [4a95c00e0f94] 2025.07.28 04:41:55.250583 [ 795361 ] {af513402-2259-447c-9568-aa4f28881622} executeQuery: Code: 49. DB::Exception: Expected JOIN table expression to be table, table function, query or union node. Actual ANY LEFT JOIN ... ON k1 = mem.k. (LOGICAL_ERROR) (version 25.8.1.1) (from [::1]:52706) (comment: 03208_multiple_joins_with_storage_join.sql) (query 20, line 36) (in query: SELECT * FROM tab ANY LEFT JOIN mem ON k1 = mem.k ANY RIGHT JOIN mem2 ON k2 = mem2.k ORDER BY tab.v ;), Stack trace (when copying this message, always include the lines below):

Test was SKIPPED and not fixed by the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical error: Expected JOIN table expression to be table, table function, query or union node

4 participants