-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[C++][Parquet] DeltaLengthByteArrayEncoder::Put
may reserve too much space
#35665
Comments
@felipecrv Do you want to take a look at this? Also @rok FYI. |
It would be a good idea to look for similar mistakes in other Parquet encoders/decoders. |
Maybe I can take a look and fix them. |
@mapleFU Feel free to. |
Thanks for catching this @pitrou! I seem to have mixed up |
(Actually it's a bit misleading. C++ |
… much space (#35670) ### Rationale for this change `BufferBuilder::Reserve` is different from `std::vector<T>::reserve`, its argument refers to additional bytes. ### What changes are included in this PR? Avoid allocating too much memory space for the encoding sink buffer. ### Are these changes tested? No. The change may affect runtime performance but not correctness. ### Are there any user-facing changes? No. * Closes: #35665 Lead-authored-by: mwish <maplewish117@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Signed-off-by: Antoine Pitrou <antoine@python.org>
DeltaLengthByteArrayEncoder::Put
may reserve too much spaceDeltaLengthByteArrayEncoder::Put
may reserve too much space
Describe the bug, including details regarding any error messages, version, and platform.
DeltaLengthByteArrayEncoder::Put
passes the total desired capacity (encoded_size_
) toBufferBuilder::Reserve
. However,BufferBuilder::Reserve
expects the additional desired capacity. This will therefore request much more memory than desired, and perhaps reallocate more often than expected.arrow/cpp/src/parquet/encoding.cc
Lines 2651 to 2675 in 3e4eaa9
Component(s)
C++
The text was updated successfully, but these errors were encountered: