mapleFU commented on code in PR #38327:
URL: https://github.com/apache/arrow/pull/38327#discussion_r1364818458


##########
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) {

Review Comment:
   I've seen the arrow-rs implemention, it check the size here. The main 
problem is that the size is not exact, the decoder will have bad tail buffer, 
like getting `0` in that multi-gzip file.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to