mapleFU commented on code in PR #37641:
URL: https://github.com/apache/arrow/pull/37641#discussion_r1337180981
##########
cpp/src/parquet/encoding.cc:
##########
@@ -3300,14 +3300,19 @@ class DeltaByteArrayDecoderImpl : public DecoderImpl,
virtual public TypedDecode
void SetData(int num_values, const uint8_t* data, int len) override {
num_values_ = num_values;
- decoder_ = std::make_shared<::arrow::bit_util::BitReader>(data, len);
+ if (decoder_) {
+ decoder_->Reset(data, len);
+ } else {
+ decoder_ = std::make_shared<::arrow::bit_util::BitReader>(data, len);
+ }
prefix_len_decoder_.SetDecoder(num_values, decoder_);
// get the number of encoded prefix lengths
int num_prefix = prefix_len_decoder_.ValidValuesCount();
// call prefix_len_decoder_.Decode to decode all the prefix lengths.
// all the prefix lengths are buffered in buffered_prefix_length_.
- PARQUET_THROW_NOT_OK(buffered_prefix_length_->Resize(num_prefix *
sizeof(int32_t)));
+ PARQUET_THROW_NOT_OK(buffered_prefix_length_->Resize(num_prefix *
sizeof(int32_t),
+
/*shrink_to_fit=*/false));
Review Comment:
Emmm Personally I don't think the page will be too large, but user might set
large page-size, I'll remove that
--
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]