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

Function random_null_bytes

cpp/src/arrow/testing/util.cc:59–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void random_null_bytes(int64_t n, double pct_null, uint8_t* null_bytes) {
60 const int random_seed = 0;
61 pcg32_fast gen(random_seed);
62 ::arrow::random::uniform_real_distribution<double> d(0.0, 1.0);
63 std::generate(null_bytes, null_bytes + n,
64 [&d, &gen, &pct_null] { return d(gen) > pct_null; });
65}
66
67void random_is_valid(int64_t n, double pct_null, std::vector<bool>* is_valid,
68 int random_seed) {

Callers 4

RandomDataMethod · 0.85
TEST_FFunction · 0.85
MakeListArrayFunction · 0.85
MakeRandomBooleanArrayFunction · 0.85

Calls

no outgoing calls

Tested by 4

RandomDataMethod · 0.68
TEST_FFunction · 0.68
MakeListArrayFunction · 0.68
MakeRandomBooleanArrayFunction · 0.68