MCPcopy Create free account
hub / github.com/apache/arrow / NullBitmap

Method NullBitmap

cpp/src/arrow/testing/random.cc:200–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198} // namespace
199
200std::shared_ptr<Buffer> RandomArrayGenerator::NullBitmap(int64_t size,
201 double null_probability,
202 int64_t alignment,
203 MemoryPool* memory_pool) {
204 // The bitmap generator does not care about the value distribution since it
205 // only calls the GenerateBitmap method.
206 using GenOpt = GenerateOptions<int, std::uniform_int_distribution<int>>;
207
208 GenOpt null_gen(seed(), 0, 1, null_probability);
209 std::shared_ptr<Buffer> bitmap = *AllocateEmptyBitmap(size, alignment, memory_pool);
210 null_gen.GenerateBitmap(bitmap->mutable_data(), size, nullptr);
211
212 return bitmap;
213}
214
215std::shared_ptr<Array> RandomArrayGenerator::Boolean(int64_t size,
216 double true_probability,

Callers 7

ArrayRangeEqualsStructFunction · 0.80
MakeMethod · 0.80
TEST_FFunction · 0.80
ValidityBitmapMethod · 0.80
TEST_FFunction · 0.80
MakeStructArrayFunction · 0.80

Calls 4

seedFunction · 0.85
AllocateEmptyBitmapFunction · 0.85
GenerateBitmapMethod · 0.80
mutable_dataMethod · 0.45

Tested by 4

MakeMethod · 0.64
TEST_FFunction · 0.64
ValidityBitmapMethod · 0.64
TEST_FFunction · 0.64