-
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
util/ranger: support use like
to build range for new collation columns | tidb-test=pr/2247 (#48522)
#50907
util/ranger: support use like
to build range for new collation columns | tidb-test=pr/2247 (#48522)
#50907
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
a9dfc55
to
b700bf3
Compare
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. |
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.
should this be cherry-picked?
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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.
+1
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fixdb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Manually cherry-pick in #51164. |
This is an automated cherry-pick of #48522
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.