Skip to content
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

Closed
wants to merge 10 commits into from

Conversation

zz-jason
Copy link
Member

What have you changed? (mandatory)

return chunk-encoded data when the requested EncodeType is TypeArrow.

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

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)

encoder := chunk.NewCodec(respColTypes)
for i := range rows {
for j, ordinal := range colOrdinal {
colDatum, err := tablecodec.DecodeColumnValue(rows[i][ordinal], colTypes[ordinal], loc)
Copy link
Member

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)
Copy link
Contributor

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?

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason
Copy link
Member Author

/run-integration-common-test tikv=pr/3398

respColTypes = append(respColTypes, colTypes[ordinal])
}

chk := chunk.NewChunkWithCapacity(respColTypes, 32)
Copy link
Contributor

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?

Copy link
Member Author

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.

@zz-jason
Copy link
Member Author

/run-integration-common-test tikv=pr/3398

@zz-jason
Copy link
Member Author

/run-common-test

@zz-jason
Copy link
Member Author

/run-integration-common-test tikv=pr/3398
/run-common-test

@zz-jason
Copy link
Member Author

/run-integration-common-test tikv=pr/3398
/run-common-test

@zz-jason
Copy link
Member Author

zz-jason commented Sep 4, 2018

/run-integration-common-test tikv=pr/3398

@zz-jason
Copy link
Member Author

closed due to outdated

@zz-jason zz-jason closed this Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants