-
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
util/ranger: support use like
to build range for new collation columns | tidb-test=pr/2247
#48522
Conversation
Skipping CI for Draft Pull Request. |
Skipping CI for Draft Pull Request. |
/test all |
/retest |
/retest |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #48522 +/- ##
================================================
+ Coverage 71.0446% 72.1677% +1.1230%
================================================
Files 1368 1405 +37
Lines 402955 414519 +11564
================================================
+ Hits 286278 299149 +12871
+ Misses 96736 96533 -203
+ Partials 19941 18837 -1104
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test all |
/test unit-test |
@time-and-fate: The specified target(s) for
Use In response to this:
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. |
/test unit-test |
@time-and-fate: The specified target(s) for
Use In response to this:
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, winoros 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 |
/cherry-pick release-7.5 |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot: new pull request could not be created: failed to create pull request against pingcap/tidb#release-7.5 from head ti-chi-bot:cherry-pick-48522-to-release-7.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-48522-to-release-7.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"} In response to this:
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 ti-community-infra/tichi repository. |
/cherrypick release-7.1 |
@hawkingrei: new pull request created to branch In response to this:
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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #48181 close #49138
What is changed and how it works?
builder
inpkg/util/ranger/points.go
, we provide a new parameterconvertToSortKey bool
. If it'strue
, we can build ranges for new collation columns innewBuildFromPatternLike
. The user ofbuilder
should specify if it should convert the string values to the sort key or keep the original value.KeyWithoutTrimRightSpace()
and then +1 to calculate the end key. TheKeyWithoutTrimRightSpace
prevents regression compared to the existing behavior for binary collations. For other details, please see the comments.pointsConvertToSortKey
, andpointConvertToSortKey
to do the conversion work.convertPoint
happens before converting to the sort key. Specifically, it's called inpoints2Ranges
,appendPoints2Ranges
, andpoints2TableRanges
, which are right afterbuild()
. Now we try to keep this logic unchanged. So we do aconvertPoint
inside these two functions before the conversion to the sort key.newTp
into thebuilder
. Therefore I merged it with the previousCollator
parameter for thebuild()
.convertPoint
is not removed because it's needed to handle non-string cases. In such a case, we need to make the existingconvertPoint
able to correctly handle the new sort key cases. Specifically, we need to use the binary collation instead of the collation of the column for theFieldType
passed intoconvertPoint
.convertStringFTToBinaryCollate()
to reduce some repeated code.pkg/util/ranger/checker.go
, remove the limitation that we can't useLIKE
function on new collation column to build ranges.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.