-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: fix uncorrect behavior of index join #11724
Conversation
@@ -1018,6 +1018,15 @@ func (s *testRangerSuite) TestColumnRange(c *C) { | |||
resultStr: "[[\"a\",\"a\"]]", | |||
length: 1, | |||
}, | |||
// This test case cannot be simplified to [1, 3] otherwise the index join will executes wrongly. |
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.
Use this test to assert that there won't be range merging in this case.
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.
Why can't merge to [1,3]? Because of the prefix index?
@winoros ci failed. Σ(° △ °|||)︴ |
@lzmhhh123 Yeah, i'm solving another one. Will fix it later. |
73f36c2
to
38a329e
Compare
@lzmhhh123 fixed |
/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.
LGTM.
Codecov Report
@@ Coverage Diff @@
## master #11724 +/- ##
================================================
- Coverage 81.5578% 81.4561% -0.1017%
================================================
Files 434 433 -1
Lines 93937 93147 -790
================================================
- Hits 76613 75874 -739
+ Misses 11876 11842 -34
+ Partials 5448 5431 -17 |
/run-sqllogic-test |
@@ -448,7 +420,10 @@ func (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, ou | |||
continue | |||
} | |||
indexInfo := path.index | |||
err := helper.analyzeLookUpFilters(indexInfo, ds, innerJoinKeys) | |||
emptyRange, err := helper.analyzeLookUpFilters(indexInfo, ds, innerJoinKeys) | |||
if emptyRange { |
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.
Otherwise we may need to return a HashJoin{Reader, Dual}
. Which i think is a little strange.
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.
Can you add a unit test to cover it?
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.
added
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
/run-all-tests |
@winoros merge failed. |
/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.
LGTM
/run-auto-merge |
/run-all-tests |
cherry pick to release-3.0 failed |
What problem does this PR solve?
close #11544 and close #11390
What is changed and how it works?
Use
BuildColumnRange
to build template range for index join.To fix two cases:
Check List
Tests
Side effects
Related changes