-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
plan, expression: support is null
in hash partition pruning
#17281
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5f04d0f
support isnull for hash partition
65c4b34
fix test
612ee87
add test
3fdedce
address comment
4029af6
address comment
1e341d5
fix ci
e79d57c
address comment
7bde29e
address comment
0de7166
Merge branch 'master' into hashPartitionNull
sre-bot bf3d511
Merge branch 'master' into hashPartitionNull
sre-bot 8308a1c
Merge branch 'master' into hashPartitionNull
sre-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,22 @@ | |
{ | ||
"name": "TestHashPartitionPruner", | ||
"cases": [ | ||
// Point Select. | ||
"explain select * from t1 where id = 7 and a = 6", | ||
"explain select * from t3 where id = 9 and a = 1", | ||
"explain select * from t2 where id = 9 and a = -110", | ||
"explain select * from t1 where id = -17", | ||
"explain select * from t2 where id = a and a = b and b = 2", | ||
// Join. | ||
"explain select * from t1 join t2 on (t1.id = t2.id) where t1.id = 5 and t2.a = 7", | ||
"explain select * from t1 left join t2 on t1.id = 1 and t2.a = 2 where t2.id = 7", | ||
"explain select * from t2 join t1 on t1.id = t2.id and t2.a = t1.id and t2.id = 12", | ||
// Negtive cases. | ||
"explain select * from t1 left join t2 on true where t1.a = 1 and false", | ||
"explain select * from t1 left join t2 on true where t1.a = 1 and null", | ||
"explain select * from t1 left join t2 on true where t1.a = null", | ||
// Case with date. | ||
"explain select * from t4 where d = '2019-10-07 10:40:00' and a = 1", | ||
"explain select * from t5 where d = '2019-10-07'" | ||
"explain select * from t5 where d = '2019-10-07'", | ||
"explain select * from t6 where a is null", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a case for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done, PTAL |
||
"explain select * from t5 where d is null", | ||
"explain select * from t7 where b = -3 and a is null" | ||
] | ||
} | ||
] |
This file contains 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
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.
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.
return ret, true, isNull
is enough?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, for expression like
(year(null) + 2)
oryear(null)
, MySQL and TiDB both produceNULL
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.
what I mean is that:
we can remove line 140~141, and change line 143 to
return ret, true, isNull