pitrou commented on code in PR #45252:
URL: https://github.com/apache/arrow/pull/45252#discussion_r1914771344
##########
cpp/src/parquet/column_writer_test.cc:
##########
@@ -1774,5 +1774,29 @@ TEST_F(TestInt32Writer, WriteKeyValueMetadataEndToEnd) {
ASSERT_EQ("bar", value);
}
+TEST_F(TestValuesWriterInt32Type, AllNullsInPageV2) {
+#ifndef ARROW_WITH_SNAPPY
+ GTEST_SKIP() << "Test requires snappy compression";
+#endif
+ // Optional and non-repeated, with definition levels
+ // but no repetition levels
+ this->SetUpSchema(Repetition::OPTIONAL);
+ this->GenerateData(SMALL_SIZE);
+ std::fill(this->def_levels_.begin(), this->def_levels_.end(), 0);
+ ColumnProperties column_properties;
+ column_properties.set_compression(Compression::SNAPPY);
Review Comment:
Why not test all compression algorithms?
##########
cpp/src/parquet/column_reader.cc:
##########
@@ -580,13 +580,20 @@ std::shared_ptr<Buffer>
SerializedPageReader::DecompressIfNeeded(
memcpy(decompressed, page_buffer->data(), levels_byte_len);
}
- // Decompress the values
- 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));
+ // GH-31992: DataPageV2 may store only levels and no values
Review Comment:
Can we fix this in the Snappy decompressor instead?
--
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]