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

Function MakeRandomListViewArray

cpp/src/arrow/ipc/test_common.cc:191–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191Status MakeRandomListViewArray(const std::shared_ptr<Array>& child_array, int num_lists,
192 bool include_nulls, MemoryPool* pool,
193 std::shared_ptr<Array>* out) {
194 const auto seed = static_cast<uint32_t>(child_array->length());
195 random::RandomArrayGenerator rand(seed);
196
197 const double null_probability = include_nulls ? 0.5 : 0.0;
198 *out = rand.ListView(*child_array, /*length=*/num_lists, null_probability,
199 /*force_empty_nulls=*/false, /*coverage=*/0.9,
200 kDefaultBufferAlignment, pool);
201 return Status::OK();
202}
203
204Status MakeRandomLargeListViewArray(const std::shared_ptr<Array>& child_array,
205 int num_lists, bool include_nulls, MemoryPool* pool,

Callers 2

MakeDeeplyNestedListViewFunction · 0.85

Calls 3

ListViewMethod · 0.80
OKFunction · 0.50
lengthMethod · 0.45

Tested by

no test coverage detected