pitrou commented on code in PR #41037:
URL: https://github.com/apache/arrow/pull/41037#discussion_r1555799766


##########
cpp/src/parquet/encoding_test.cc:
##########
@@ -635,6 +635,144 @@ TEST(BooleanArrayEncoding, AdHocRoundTrip) {
   }
 }
 
+class TestBooleanArrowDecoding : public ::testing::Test {
+ public:
+  // number of values including nulls
+  constexpr static int kNumValues = 10000;
+
+  void SetUp() override {
+    null_probabilities_ = {0.0, 0.001, 0.5, 0.999, 1.0};
+    read_batch_sizes_ = {1024, 4096, 10000};
+    true_probabilities_ = {0.0, 0.001, 0.5, 0.999, 1.0};
+  }
+  void TearDown() override {}
+
+  void InitTestCase(Encoding::type encoding, double null_probability,
+                    double true_probability) {
+    GenerateInputData(null_probability, true_probability);
+    SetupEncoderDecoder(encoding);
+  }
+
+  void GenerateInputData(double null_probability, double true_probability) {
+    ::arrow::random::RandomArrayGenerator rag(0);
+    expected_dense_ = rag.Boolean(kNumValues, true_probability, 
null_probability);
+    null_count_ = static_cast<int>(expected_dense_->null_count());
+    valid_bits_ = expected_dense_->null_bitmap_data();
+
+    // Initialize input_data_ for the encoder from the expected_array_ values
+    const auto& boolean_array =
+        static_cast<const ::arrow::BooleanArray&>(*expected_dense_);

Review Comment:
   Nit: checked_cast?



-- 
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