You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/01 18:23:26 UTC

[GitHub] [arrow] bkietz commented on a change in pull request #8761: ARROW-10697: [C++] Add notes about bitmap readers

bkietz commented on a change in pull request #8761:
URL: https://github.com/apache/arrow/pull/8761#discussion_r533626348



##########
File path: cpp/src/arrow/compute/kernels/vector_sort.cc
##########
@@ -238,21 +239,9 @@ inline void VisitRawValuesInline(const ArrayType& values,
                                  VisitorNotNull&& visitor_not_null,
                                  VisitorNull&& visitor_null) {
   const auto data = values.raw_values();
-  if (values.null_count() > 0) {
-    BitmapReader reader(values.null_bitmap_data(), values.offset(), values.length());
-    for (int64_t i = 0; i < values.length(); ++i) {
-      if (reader.IsSet()) {
-        visitor_not_null(data[i]);
-      } else {
-        visitor_null();
-      }
-      reader.Next();
-    }
-  } else {
-    for (int64_t i = 0; i < values.length(); ++i) {
-      visitor_not_null(data[i]);
-    }
-  }
+  VisitBitBlocksVoid(
+      values.null_bitmap(), values.offset(), values.length(),
+      [&](int64_t i) { visitor_not_null(data[i]); }, [&]() { visitor_null(); });

Review comment:
       Did this have any impact on the sort benchmark?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org