pitrou commented on code in PR #55306:
URL: https://github.com/apache/arrow/pull/55306#discussion_r4410475005
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1004,22 +1004,26 @@ void ColumnWriterImpl::BuildDataPageV1(int64_t
definition_levels_rle_size,
int64_t repetition_levels_rle_size,
int64_t uncompressed_size,
const std::shared_ptr<Buffer>& values) {
- // Use Arrow::Buffer::shrink_to_fit = false
- // underlying buffer only keeps growing. Resize to a smaller size does not
reallocate.
- PARQUET_THROW_NOT_OK(uncompressed_data_->Resize(uncompressed_size, false));
- ConcatenateBuffers(definition_levels_rle_size, repetition_levels_rle_size,
values,
- uncompressed_data_->mutable_data());
+ auto uncompressed_data = values;
+ if (definition_levels_rle_size > 0 || repetition_levels_rle_size > 0) {
+ // Use Arrow::Buffer::shrink_to_fit = false
+ // underlying buffer only keeps growing. Resize to a smaller size does not
reallocate.
+ PARQUET_THROW_NOT_OK(uncompressed_data_->Resize(uncompressed_size, false));
Review Comment:
Please name the parameter here
```suggestion
PARQUET_THROW_NOT_OK(uncompressed_data_->Resize(uncompressed_size,
/*xxx=*/ false));
```
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1089,8 +1093,6 @@ void ColumnWriterImpl::BuildDataPageV2(int64_t
definition_levels_rle_size,
// Write the page to OutputStream eagerly if there is no dictionary or
// if dictionary encoding has fallen back to PLAIN
if (has_dictionary_ && !fallback_) { // Save pages until end of dictionary
encoding
- PARQUET_ASSIGN_OR_THROW(auto data_copy,
- combined->CopySlice(0, combined->size(),
allocator_));
Review Comment:
So `data_copy` was unused? 🤨
--
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]