pitrou commented on code in PR #38327:
URL: https://github.com/apache/arrow/pull/38327#discussion_r1363943227
##########
cpp/src/parquet/column_reader.cc:
##########
@@ -594,10 +594,17 @@ std::shared_ptr<Buffer>
SerializedPageReader::DecompressIfNeeded(
}
// Decompress the values
- PARQUET_THROW_NOT_OK(decompressor_->Decompress(
- compressed_len - levels_byte_len, page_buffer->data() + levels_byte_len,
- uncompressed_len - levels_byte_len,
- decompression_buffer_->mutable_data() + levels_byte_len));
+ PARQUET_ASSIGN_OR_THROW(
+ auto decompressed_len,
+ decompressor_->Decompress(compressed_len - levels_byte_len,
+ page_buffer->data() + levels_byte_len,
+ uncompressed_len - levels_byte_len,
+ decompression_buffer_->mutable_data() +
levels_byte_len));
+ if (decompressed_len != uncompressed_len - levels_byte_len) {
+ throw ParquetException("Page didn't decompress to expected size, expect: "
+
Review Comment:
```suggestion
throw ParquetException("Page didn't decompress to expected size,
expected: " +
```
--
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]