jp0317 commented on code in PR #39818:
URL: https://github.com/apache/arrow/pull/39818#discussion_r1468337574
##########
cpp/src/parquet/column_reader.cc:
##########
@@ -1478,13 +1478,14 @@ class TypedRecordReader : public
TypedColumnReaderImpl<DType>,
// We skipped the levels by incrementing 'levels_position_'. For values
// we do not have a buffer, so we need to read them and throw them away.
// First we need to figure out how many present/not-null values there are.
- std::shared_ptr<::arrow::ResizableBuffer> valid_bits;
- valid_bits = AllocateBuffer(this->pool_);
-
PARQUET_THROW_NOT_OK(valid_bits->Resize(bit_util::BytesForBits(skipped_records),
- /*shrink_to_fit=*/true));
+ if (valid_bits_ == nullptr) {
+ valid_bits_ = AllocateBuffer(this->pool_);
+ }
+
PARQUET_THROW_NOT_OK(valid_bits_->Resize(bit_util::BytesForBits(skipped_records),
+ /*shrink_to_fit=*/true));
Review Comment:
edited, after a 2nd though, i think with a new change
(resize(skipped_records) then resize(0)) it can just be false, or does not
really matter true or false
--
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]