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


##########
cpp/src/parquet/decoder.cc:
##########
@@ -347,22 +384,29 @@ int PlainDecoder<DType>::DecodeArrow(
 
   constexpr int value_size = static_cast<int>(sizeof(value_type));
   int values_decoded = num_values - null_count;
-  if (ARROW_PREDICT_FALSE(len_ < value_size * values_decoded)) {
+  if (ARROW_PREDICT_FALSE(this->len_ < value_size * values_decoded)) {
     ParquetException::EofException();
   }
 
-  PARQUET_THROW_NOT_OK(builder->Reserve(num_values));
+  const uint8_t* data = this->data_;
 
-  VisitNullBitmapInline(
-      valid_bits, valid_bits_offset, num_values, null_count,
-      [&]() {
-        builder->UnsafeAppend(SafeLoadAs<value_type>(data_));
-        data_ += sizeof(value_type);
-      },
-      [&]() { builder->UnsafeAppendNull(); });
-
-  num_values_ -= values_decoded;
-  len_ -= sizeof(value_type) * values_decoded;
+  PARQUET_THROW_NOT_OK(builder->Reserve(num_values));
+  PARQUET_THROW_NOT_OK(
+      VisitBitRuns(valid_bits, valid_bits_offset, num_values,

Review Comment:
   So bit runs is used instead here? 🤔 Would the case like [null 0 null 0 ...] 
be slower?



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