-
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
executor: fix select wrong partition for hash partition table #50430
Conversation
Hi @Defined2014. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #50430 +/- ##
=================================================
- Coverage 70.0709% 55.7916% -14.2794%
=================================================
Files 1444 1551 +107
Lines 420010 584982 +164972
=================================================
+ Hits 294305 326371 +32066
- Misses 105423 235902 +130479
- Partials 20282 22709 +2427
Flags with carried forward coverage won't be shown. Click here to find out more.
|
} | ||
} | ||
|
||
// if range is less than the number of partitions, there will be unused partitions we can prune out. | ||
if rangeScalar < uint64(numPartitions) && !highIsNull && !lowIsNull { | ||
var i int64 | ||
for i = 0; i <= int64(rangeScalar); i++ { | ||
idx := mathutil.Abs(offset+i) % int64(numPartitions) | ||
idx := mathutil.Abs((posLow + i) % int64(numPartitions)) |
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.
Ref https://github.com/pingcap/tidb/pull/49853/files#diff-4990f33f249ec8823358eef763ccfccd9284b58d4942eba35b7b4e22c16b1a33L193, let it same as before.
Although I think the behaviour of hash function is strange, it already works for a long time. Just change it back.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tiancaiamao, xhebox 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:
|
What problem does this PR solve?
Issue Number: close #50427
Problem Summary: Still caused by #49853, I made a mistake about mathutil.Abs and select a wrong partiton for hash partition table.
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.