-
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
*: remove ExtraPidCol
and replace it with ExtraPhysTblIDCol
#53974
Conversation
Skipping CI for Draft Pull Request. |
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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #53974 +/- ##
=================================================
- Coverage 72.5434% 56.2551% -16.2884%
=================================================
Files 1508 1638 +130
Lines 431744 616321 +184577
=================================================
+ Hits 313202 346712 +33510
- Misses 99141 246330 +147189
- Partials 19401 23279 +3878
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow 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.
Rest LGTM
@@ -932,8 +925,16 @@ func (e *closureExecutor) indexScanProcessCore(key, value []byte) error { | |||
} | |||
// Add ExtraPhysTblID if requested | |||
// Assumes it is always last! | |||
if e.columnInfos[len(e.columnInfos)-1].ColumnId == model.ExtraPhysTblID { | |||
tblID := tablecodec.DecodeTableID(key) | |||
if e.columnInfos[len(e.columnInfos)-1].ColumnId == model.ExtraPhysTblID && min(len(e.fieldTps), len(values)) < len(e.columnInfos) { |
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.
this min func usage should be added with comments
tblID := tablecodec.DecodeTableID(key) | ||
|
||
// when *e.physTblIDColIdx < min(len(e.fieldTypes), len(values)), pid is included in values and already filled in e.chk | ||
if e.physTblIDColIdx != nil && *e.physTblIDColIdx >= min(len(e.fieldTypes), len(values)) { |
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.
same here,better add a small 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.
what the main reason for mismatch of len(e.fieldTypes) and len(values)?
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.
Made some mistakes and updated.
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, with some minor questions.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, mjonss, tangenta, XuHuaiyu 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 |
What problem does this PR solve?
Issue Number: close #53929
Problem Summary:
The problem is we added
ExtraPhysTblID
to DataSource's schema for get the partition id. But it returns table id instead of partition id when usingindexReader
executor working with global index, because we decode index key to get it. After deep into the code, I found it's hard to fix it elegantly. In logical plan builder phase, we can't determined it will select a global index path or not which means we can't addExtraPidColID
column intoDataSource
in this phase.Then I think maybe we could combine two columns, let it gets return values from different place(Seems
ExtraPhysTblID
is useless for global index, always return table ID for every records). When it is a global index, we could decode pid by index value, otherwise we could decode table id by index/row key. Also it could reduce potential errors, no need to select to useExtraPhysTblID
orExtraPidColID
when we write the code.Related PR in TiKV side tikv/tikv#17141
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.