mapleFU commented on code in PR #34526:
URL: https://github.com/apache/arrow/pull/34526#discussion_r1138947189
##########
cpp/src/parquet/encoding.cc:
##########
@@ -512,14 +520,7 @@ class DictEncoderImpl : public EncoderImpl, virtual public
DictEncoder<DType> {
/// Returns a conservative estimate of the number of bytes needed to encode
the buffered
/// indices. Used to size the buffer passed to WriteIndices().
int64_t EstimatedDataEncodedSize() override {
- // Note: because of the way RleEncoder::CheckBufferFull() is called, we
have to
- // reserve
- // an extra "RleEncoder::MinBufferSize" bytes. These extra bytes won't be
used
- // but not reserving them would cause the encoder to fail.
- return 1 +
- ::arrow::util::RleEncoder::MaxBufferSize(
- bit_width(), static_cast<int>(buffered_indices_.size())) +
- ::arrow::util::RleEncoder::MinBufferSize(bit_width());
+ return RlePreserveBufferSize(static_cast<int>(buffered_indices_.size()),
bit_width());
Review Comment:
They should be same, but they're used in different encoders
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]