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/09/16 15:42:18 UTC

[GitHub] [arrow] emkornfield commented on a change in pull request #8203: ARROW-10024: [C++][Parquet] Create nested reading benchmarks

emkornfield commented on a change in pull request #8203:
URL: https://github.com/apache/arrow/pull/8203#discussion_r489538445



##########
File path: cpp/src/arrow/testing/random.cc
##########
@@ -250,12 +267,20 @@ std::shared_ptr<Array> RandomArrayGenerator::StringWithRepeats(int64_t size,
 }
 
 std::shared_ptr<Array> RandomArrayGenerator::Offsets(int64_t size, int32_t first_offset,
-                                                     int32_t last_offset) {
+                                                     int32_t last_offset,
+                                                     double null_probability) {
   using GenOpt = GenerateOptions<int32_t, std::uniform_int_distribution<int32_t>>;
-  GenOpt options(seed(), first_offset, last_offset, /*null_probability=*/0);
+  GenOpt options(seed(), first_offset, last_offset, null_probability);
 
   BufferVector buffers{2};
 
+  int64_t null_count = 0;
+  buffers[0] = *AllocateEmptyBitmap(size);
+  options.GenerateBitmap(buffers[0]->mutable_data(), size, &null_count);
+  // Make sure the first and last entry are non-null

Review comment:
       why is this important?




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