-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize (left outer) (anti) semi join with other conditions #8339
Conversation
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
/run-all-tests |
/run-all-tests |
797a3b8
to
33f6d1a
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
/run-integration-test |
/rebuild |
block.insert(src_column); | ||
} | ||
|
||
if constexpr (STRICTNESS == ASTTableJoin::Strictness::All) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STRICTNESS == ASTTableJoin::Strictness::All
means has other condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
if constexpr (KIND == ASTTableJoin::Kind::LeftOuterSemi || KIND == ASTTableJoin::Kind::LeftOuterAnti) | ||
{ | ||
auto * left_semi_column = typeid_cast<ColumnNullable *>(added_columns[right_columns - 1].get()); | ||
left_semi_column_data = &typeid_cast<ColumnVector<Int8> &>(left_semi_column->getNestedColumn()).getData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reserve for left_semi_column_data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
dbms/src/Interpreters/Join.cpp
Outdated
else | ||
{ | ||
auto result = res[i].getResult(); | ||
if constexpr (KIND == ASTTableJoin::Kind::Semi || KIND == ASTTableJoin::Kind::Anti) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like for Semi
and Anti
join, the code branch of Any/All
strictness can be merged into one if you define operator bool()
on the result as result == SemiJoinResultType::TRUE_VALUE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I use the function isTrueSemiJoinResult
because result
is an enum or bool type.
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
Need to set tiflash/dbms/src/Interpreters/Join.cpp Lines 187 to 188 in e5eaf31
|
Signed-off-by: gengliqi <gengliqiii@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: gengliqi <gengliqiii@gmail.com>
1ea3676
to
e25d317
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: windtalker, yibin87 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
/run-unit-test |
What problem does this PR solve?
Issue Number: close #8262
Problem Summary:
See #8262
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note