Support conditions in JOIN ON section#24420
Merged
abyss7 merged 27 commits intoClickHouse:masterfrom Jul 21, 2021
Merged
Conversation
815785a to
26a9778
Compare
98bbd41 to
a352a2d
Compare
|
many thanks for your work ! |
abyss7
suggested changes
Jun 29, 2021
Contributor
abyss7
left a comment
There was a problem hiding this comment.
You should add some tests
| if (table_numbers.first == JoinIdentifierPos::Unknown) | ||
| throw Exception("Ambiguous column in expression '" + queryToString(ast) + "' in JOIN ON section", | ||
| ErrorCodes::AMBIGUOUS_COLUMN_NAME); | ||
| data.analyzed_join.addJoinCondition(ast, isLeftIdentifier(table_numbers.first)); |
Contributor
There was a problem hiding this comment.
[self-note] Putting ASTFunction into on_filter_condition_asts_*
|
|
||
| String deriveTempName(const String & name) | ||
| { | ||
| return "--" + name; |
Member
Author
There was a problem hiding this comment.
Some internal table name needed, I haven't found good solution for it. This column added at the beginning of function joinBlock and removed at the end, so it's not visible outside. But we haven't some mechanism for generating temporary names that also cannot be already presented in block.
Do you have any ideas how to solve it?
Member
Author
|
Merged with master. @abyss7 take a look, please, review comments are resolved |
Contributor
|
Internal documentation ticket: DOCSUP-12064 |
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.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
JOIN ONsection #21868Detailed description / Documentation draft:
Conditions for left or right table columns can be specified in
JOIN ONsection as sequence of expression connected withAND, in addition to main equality. Only rows where conditions hold will be joined.Current status: