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
mocktikv: return Chunk encoded data #7191
Conversation
encoder := chunk.NewCodec(respColTypes) | ||
for i := range rows { | ||
for j, ordinal := range colOrdinal { | ||
colDatum, err := tablecodec.DecodeColumnValue(rows[i][ordinal], colTypes[ordinal], loc) |
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.
We can use codec.NewDecoder
and (*Decoder).DecodeOne
.
for _, ordinal := range colOrdinal { | ||
respColTypes = append(respColTypes, colTypes[ordinal]) | ||
} | ||
chk := chunk.NewChunkWithCapacity(respColTypes, 32) |
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 the capacity equals rowsPerChunk
?
/run-all-tests |
/run-integration-common-test tikv=pr/3398 |
respColTypes = append(respColTypes, colTypes[ordinal]) | ||
} | ||
|
||
chk := chunk.NewChunkWithCapacity(respColTypes, 32) |
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.
where does the 32
come from? Should it be equal to rowsPerChunk
?
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.
Uh.. Yes, it should better be equal to rowsPerChunk
. I'll refactor this. BTW, 32
does not affect the correctness.
/run-integration-common-test tikv=pr/3398 |
/run-common-test |
/run-integration-common-test tikv=pr/3398 |
/run-integration-common-test tikv=pr/3398 |
/run-integration-common-test tikv=pr/3398 |
closed due to outdated |
What have you changed? (mandatory)
return chunk-encoded data when the requested
EncodeType
isTypeArrow
.What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
Does this PR affect tidb-ansible update? (mandatory)
Does this PR need to be added to the release notes? (mandatory)
Refer to a related PR or issue link (optional)
Benchmark result if necessary (optional)
Add a few positive/negative examples (optional)