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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to