You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/08/31 15:31:04 UTC
[GitHub] [arrow] wgtmac commented on a diff in pull request #36955: GH-36882: [C++][Parquet] Default RLE for bool values in the parquet version 2.x
wgtmac commented on code in PR #36955:
URL: https://github.com/apache/arrow/pull/36955#discussion_r1311819114
##########
cpp/src/parquet/column_writer_test.cc:
##########
@@ -757,21 +765,36 @@ TEST_F(TestValuesWriterInt32Type, OptionalNullValueChunk) {
ASSERT_EQ(0, this->values_read_);
}
+class TestBooleanValuesWriter : public TestPrimitiveWriter<BooleanType> {
+ public:
+ void TestWithEncoding(ParquetVersion::type version, Encoding::type encoding) {
+ this->SetUpSchema(Repetition::REQUIRED);
+ auto writer = this->BuildWriter(SMALL_SIZE, ColumnProperties(), version,
+ /*enable_checksum*/ false);
+ for (int i = 0; i < SMALL_SIZE; i++) {
+ bool value = (i % 2 == 0) ? true : false;
+ writer->WriteBatch(1, nullptr, nullptr, &value);
+ }
+ writer->Close();
+ this->ReadColumn();
+ for (int i = 0; i < SMALL_SIZE; i++) {
+ ASSERT_EQ((i % 2 == 0) ? true : false, this->values_out_[i]) << i;
+ }
+ const auto& encodings = this->metadata_encodings();
+ auto iter = std::find(encodings.begin(), encodings.end(), encoding);
+ ASSERT_TRUE(iter != encodings.end());
Review Comment:
No, in the case of parquet version 1.0, both `PLAIN` and `RLE` exists. The reason is here: https://github.com/apache/arrow/blob/main/cpp/src/parquet/metadata.cc#L1487-L1492
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org