Skip to content

Fix JOIN rewriters inconsistency#9830

Merged
4ertus2 merged 3 commits intoClickHouse:masterfrom
4ertus2:bugs
Mar 23, 2020
Merged

Fix JOIN rewriters inconsistency#9830
4ertus2 merged 3 commits intoClickHouse:masterfrom
4ertus2:bugs

Conversation

@4ertus2
Copy link
Copy Markdown
Contributor

@4ertus2 4ertus2 commented Mar 23, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix 'COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query' error in case of subqueries with COMMA JOIN out of tables lists (i.e. in WHERE). Fixes #9782

Detailed description / Documentation draft:
Make JoinToSubqueryTransformVisitor consistent with CrossToInnerJoinVisitor: do not go into subqueries.

throw Exception("Multiple CROSS/COMMA JOIN do not support USING", ErrorCodes::NOT_IMPLEMENTED);

if (num_comma && (num_comma != (joined_tables.size() - 1)))
throw Exception("Mix of COMMA and other JOINS is not supported", ErrorCodes::NOT_IMPLEMENTED);
Copy link
Copy Markdown
Contributor Author

@4ertus2 4ertus2 Mar 23, 2020

Choose a reason for hiding this comment

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

It also removes mix COMMA + other JOIN restriction (for TPC-DS support).

Copy link
Copy Markdown
Contributor Author

@4ertus2 4ertus2 Mar 23, 2020

Choose a reason for hiding this comment

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

FYI @alex-zaitsev
Fix for 2 cases in TPC-DS list.
There're same 'Missing columns' and 'exists/not exists' issues in TPC-H test too.

@4ertus2 4ertus2 merged commit 38cbf3e into ClickHouse:master Mar 23, 2020
@alesapin alesapin added the pr-bugfix Pull request with bugfix, not backported by default label Mar 26, 2020
4ertus2 added a commit that referenced this pull request Mar 26, 2020
* fix join rewrites: inconsistent visitors
@alesapin alesapin added the v20.3 label Mar 26, 2020
alesapin pushed a commit that referenced this pull request Mar 26, 2020
@qoega qoega mentioned this pull request Mar 26, 2020
16 tasks
@alex-zaitsev alex-zaitsev mentioned this pull request Mar 26, 2020
24 tasks
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query

3 participants