bkmgit commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r767650639



##########
File path: cpp/src/arrow/util/bit_block_counter.h
##########
@@ -586,5 +961,144 @@ static void VisitTwoBitBlocksVoid(const 
std::shared_ptr<Buffer>& left_bitmap_buf
   }
 }
 
+template <typename VisitNotNull, typename VisitNull>
+static void VisitThreeBitBlocksVoid(
+    const std::shared_ptr<Buffer>& left_bitmap_buf, int64_t left_offset,
+    const std::shared_ptr<Buffer>& mid_bitmap_buf, int64_t mid_offset,
+    const std::shared_ptr<Buffer>& right_bitmap_buf, int64_t right_offset, 
int64_t length,
+    VisitNotNull&& visit_not_null, VisitNull&& visit_null) {
+  if (((left_bitmap_buf == NULLPTR) && (mid_bitmap_buf == NULLPTR)) ||
+      ((mid_bitmap_buf == NULLPTR) && (right_bitmap_buf == NULLPTR)) ||
+      ((left_bitmap_buf == NULLPTR) && (right_bitmap_buf == NULLPTR))) {
+    // At most one bitmap is present
+    if ((left_bitmap_buf == NULLPTR) && (mid_bitmap_buf == NULLPTR)) {
+      return VisitBitBlocksVoid(right_bitmap_buf, right_offset, length,
+                                std::forward<VisitNotNull>(visit_not_null),
+                                std::forward<VisitNull>(visit_null));
+    } else if ((mid_bitmap_buf == NULLPTR) && (right_bitmap_buf == NULLPTR)) {
+      return VisitBitBlocksVoid(left_bitmap_buf, left_offset, length,
+                                std::forward<VisitNotNull>(visit_not_null),
+                                std::forward<VisitNull>(visit_null));
+    } else {
+      return VisitBitBlocksVoid(mid_bitmap_buf, mid_offset, length,
+                                std::forward<VisitNotNull>(visit_not_null),
+                                std::forward<VisitNull>(visit_null));
+    }
+  }
+  // Two bitmaps are present
+  if (left_bitmap_buf == NULLPTR) {
+    const uint8_t* mid_bitmap = mid_bitmap_buf->data();

Review comment:
       Thanks for the suggestion.




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